Class FileChooserWidget
- All Implemented Interfaces:
Proxy
,Accessible
,Buildable
,ConstraintTarget
,FileChooser
GtkFileChooserWidget
is a widget for choosing files.
It exposes the FileChooser
interface, and you should
use the methods of this interface to interact with the
widget.
Shortcuts and Gestures
GtkFileChooserWidget
supports the following keyboard shortcuts:
Shift
+F10
orMenu
opens the context menu.
The following signals have default keybindings:
Gtk.FileChooserWidget::desktop-folder
Gtk.FileChooserWidget::down-folder
Gtk.FileChooserWidget::home-folder
Gtk.FileChooserWidget::location-popup
Gtk.FileChooserWidget::location-popup-on-paste
Gtk.FileChooserWidget::location-toggle-popup
Gtk.FileChooserWidget::places-shortcut
Gtk.FileChooserWidget::quick-bookmark
Gtk.FileChooserWidget::recent-shortcut
Gtk.FileChooserWidget::search-shortcut
Gtk.FileChooserWidget::show-hidden
Gtk.FileChooserWidget::up-folder
CSS nodes
GtkFileChooserWidget
has a single CSS node with name filechooser.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
FileChooserWidget.Builder<B extends FileChooserWidget.Builder<B>>
Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static interface
Deprecated.Functional interface declaration of theDesktopFolderCallback
callback.static interface
Deprecated.Functional interface declaration of theDownFolderCallback
callback.static interface
Deprecated.Functional interface declaration of theHomeFolderCallback
callback.static interface
Deprecated.Functional interface declaration of theLocationPopupCallback
callback.static interface
Deprecated.Functional interface declaration of theLocationPopupOnPasteCallback
callback.static interface
Deprecated.Functional interface declaration of theLocationTogglePopupCallback
callback.static interface
Deprecated.Functional interface declaration of thePlacesShortcutCallback
callback.static interface
Deprecated.Functional interface declaration of theQuickBookmarkCallback
callback.static interface
Deprecated.Functional interface declaration of theRecentShortcutCallback
callback.static interface
Deprecated.Functional interface declaration of theSearchShortcutCallback
callback.static interface
Deprecated.Functional interface declaration of theShowHiddenCallback
callback.static interface
Deprecated.Functional interface declaration of theUpFolderCallback
callback.Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.FileChooser
FileChooser.FileChooserImpl
-
Constructor Summary
ConstructorDescriptionFileChooserWidget
(MemorySegment address) Deprecated.Create a FileChooserWidget proxy instance for the provided memory address.FileChooserWidget
(FileChooserAction action) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected FileChooserWidget
asParent()
Deprecated.Returns this instance as if it were its parent type.static FileChooserWidget.Builder
<? extends FileChooserWidget.Builder> builder()
Deprecated.AFileChooserWidget.Builder
object constructs aFileChooserWidget
with the specified properties.void
Deprecated.Emits the "desktop-folder" signal.void
Deprecated.Emits the "down-folder" signal.void
Deprecated.Emits the "home-folder" signal.void
emitLocationPopup
(String path) Deprecated.Emits the "location-popup" signal.void
Deprecated.Emits the "location-popup-on-paste" signal.void
Deprecated.Emits the "location-toggle-popup" signal.void
Deprecated.Emits the "places-shortcut" signal.void
emitQuickBookmark
(int bookmarkIndex) Deprecated.Emits the "quick-bookmark" signal.void
Deprecated.Emits the "recent-shortcut" signal.void
Deprecated.Emits the "search-shortcut" signal.void
Deprecated.Emits the "show-hidden" signal.void
Deprecated.Emits the "up-folder" signal.static Type
getType()
Deprecated.Get the GType of the FileChooserWidget classDeprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMemoryLayout, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.FileChooser
addChoice, addFilter, addShortcutFolder, getAction, getChoice, getCreateFolders, getCurrentFolder, getCurrentName, getFile, getFiles, getFilter, getFilters, getSelectMultiple, getShortcutFolders, removeChoice, removeFilter, removeShortcutFolder, setAction, setChoice, setCreateFolders, setCurrentFolder, setCurrentName, setFile, setFilter, setSelectMultiple
-
Constructor Details
-
FileChooserWidget
Deprecated.Create a FileChooserWidget proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
FileChooserWidget
Deprecated.Direct use ofGtkFileChooserWidget
is deprecatedCreates a newGtkFileChooserWidget
.This is a file chooser widget that can be embedded in custom windows, and it is the same widget that is used by
GtkFileChooserDialog
.- Parameters:
action
- Open or save mode for the widget
-
-
Method Details
-
getType
Deprecated.Get the GType of the FileChooserWidget class- Returns:
- the GType
-
asParent
Deprecated.Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
onDesktopFolder
public SignalConnection<FileChooserWidget.DesktopFolderCallback> onDesktopFolder(FileChooserWidget.DesktopFolderCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser show the user's Desktop folder in the file list.
The default binding for this signal is
Alt
-D
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDesktopFolder
public void emitDesktopFolder()Deprecated.Emits the "desktop-folder" signal. SeeonDesktopFolder(org.gnome.gtk.FileChooserWidget.DesktopFolderCallback)
. -
onDownFolder
public SignalConnection<FileChooserWidget.DownFolderCallback> onDownFolder(FileChooserWidget.DownFolderCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser go to a child of the current folder in the file hierarchy. The subfolder that will be used is displayed in the path bar widget of the file chooser. For example, if the path bar is showing "/foo/bar/baz", with bar currently displayed, then this will cause the file chooser to switch to the "baz" subfolder.
The default binding for this signal is
Alt
-Down
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDownFolder
public void emitDownFolder()Deprecated.Emits the "down-folder" signal. SeeonDownFolder(org.gnome.gtk.FileChooserWidget.DownFolderCallback)
. -
onHomeFolder
public SignalConnection<FileChooserWidget.HomeFolderCallback> onHomeFolder(FileChooserWidget.HomeFolderCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser show the user's home folder in the file list.
The default binding for this signal is
Alt
-Home
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitHomeFolder
public void emitHomeFolder()Deprecated.Emits the "home-folder" signal. SeeonHomeFolder(org.gnome.gtk.FileChooserWidget.HomeFolderCallback)
. -
onLocationPopup
public SignalConnection<FileChooserWidget.LocationPopupCallback> onLocationPopup(FileChooserWidget.LocationPopupCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser show a "Location" prompt which the user can use to manually type the name of the file he wishes to select.
The default bindings for this signal are
Control
-L
with apath
string of "" (the empty string). It is also bound to/
with apath
string of "/
" (a slash): this lets you type/
and immediately type a path name. On Unix systems, this is bound to~
(tilde) with apath
string of "~" itself for access to home directories.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitLocationPopup
Deprecated.Emits the "location-popup" signal. SeeonLocationPopup(org.gnome.gtk.FileChooserWidget.LocationPopupCallback)
. -
onLocationPopupOnPaste
public SignalConnection<FileChooserWidget.LocationPopupOnPasteCallback> onLocationPopupOnPaste(FileChooserWidget.LocationPopupOnPasteCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser show a "Location" prompt when the user pastes into a
GtkFileChooserWidget
.The default binding for this signal is
Control
-V
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitLocationPopupOnPaste
public void emitLocationPopupOnPaste()Deprecated.Emits the "location-popup-on-paste" signal. SeeonLocationPopupOnPaste(org.gnome.gtk.FileChooserWidget.LocationPopupOnPasteCallback)
. -
onLocationTogglePopup
public SignalConnection<FileChooserWidget.LocationTogglePopupCallback> onLocationTogglePopup(FileChooserWidget.LocationTogglePopupCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to toggle the visibility of a "Location" prompt which the user can use to manually type the name of the file he wishes to select.
The default binding for this signal is
Control
-L
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitLocationTogglePopup
public void emitLocationTogglePopup()Deprecated.Emits the "location-toggle-popup" signal. SeeonLocationTogglePopup(org.gnome.gtk.FileChooserWidget.LocationTogglePopupCallback)
. -
onPlacesShortcut
public SignalConnection<FileChooserWidget.PlacesShortcutCallback> onPlacesShortcut(FileChooserWidget.PlacesShortcutCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to move the focus to the places sidebar.
The default binding for this signal is
Alt
-P
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitPlacesShortcut
public void emitPlacesShortcut()Deprecated.Emits the "places-shortcut" signal. SeeonPlacesShortcut(org.gnome.gtk.FileChooserWidget.PlacesShortcutCallback)
. -
onQuickBookmark
public SignalConnection<FileChooserWidget.QuickBookmarkCallback> onQuickBookmark(FileChooserWidget.QuickBookmarkCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser switch to the bookmark specified in the
bookmarkIndex
parameter. For example, if you have three bookmarks, you can pass 0, 1, 2 to this signal to switch to each of them, respectively.The default binding for this signal is
Alt
-1
,Alt
-2
, etc. untilAlt
-0
. Note that in the default binding, thatAlt
-1
is actually defined to switch to the bookmark at index 0, and so on successively.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitQuickBookmark
public void emitQuickBookmark(int bookmarkIndex) Deprecated.Emits the "quick-bookmark" signal. SeeonQuickBookmark(org.gnome.gtk.FileChooserWidget.QuickBookmarkCallback)
. -
onRecentShortcut
public SignalConnection<FileChooserWidget.RecentShortcutCallback> onRecentShortcut(FileChooserWidget.RecentShortcutCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser show the Recent location.
The default binding for this signal is
Alt
-R
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitRecentShortcut
public void emitRecentShortcut()Deprecated.Emits the "recent-shortcut" signal. SeeonRecentShortcut(org.gnome.gtk.FileChooserWidget.RecentShortcutCallback)
. -
onSearchShortcut
public SignalConnection<FileChooserWidget.SearchShortcutCallback> onSearchShortcut(FileChooserWidget.SearchShortcutCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser show the search entry.
The default binding for this signal is
Alt
-S
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitSearchShortcut
public void emitSearchShortcut()Deprecated.Emits the "search-shortcut" signal. SeeonSearchShortcut(org.gnome.gtk.FileChooserWidget.SearchShortcutCallback)
. -
onShowHidden
public SignalConnection<FileChooserWidget.ShowHiddenCallback> onShowHidden(FileChooserWidget.ShowHiddenCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser display hidden files.
The default binding for this signal is
Control
-H
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitShowHidden
public void emitShowHidden()Deprecated.Emits the "show-hidden" signal. SeeonShowHidden(org.gnome.gtk.FileChooserWidget.ShowHiddenCallback)
. -
onUpFolder
public SignalConnection<FileChooserWidget.UpFolderCallback> onUpFolder(FileChooserWidget.UpFolderCallback handler) Deprecated.Emitted when the user asks for it.This is a keybinding signal.
This is used to make the file chooser go to the parent of the current folder in the file hierarchy.
The default binding for this signal is
Alt
-Up
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitUpFolder
public void emitUpFolder()Deprecated.Emits the "up-folder" signal. SeeonUpFolder(org.gnome.gtk.FileChooserWidget.UpFolderCallback)
. -
builder
Deprecated.AFileChooserWidget.Builder
object constructs aFileChooserWidget
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withFileChooserWidget.Builder.build()
.
-
GtkFileChooserWidget
is deprecated