Package ch.bailu.gtk.gtk
Klasse FileDialog
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gtk.FileDialog
- Alle implementierten Schnittstellen:
PointerInterface
Asynchronous API to present a file chooser dialog.
`GtkFileDialog` collects the arguments that are needed to present
the dialog to the user, such as a title for the dialog and whether
it should be modal.
The dialog is shown with [method@Gtk.FileDialog.open],
[method@Gtk.FileDialog.save], etc.
`GtkFileDialog` collects the arguments that are needed to present
the dialog to the user, such as a title for the dialog and whether
it should be modal.
The dialog is shown with [method@Gtk.FileDialog.open],
[method@Gtk.FileDialog.save], etc.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungRetrieves the text used by the dialog on its accept button.static ClassHandler
Gets the filter that will be selected by default
in the file chooser dialog.Gets the filters that will be offered to the user
in the file chooser dialog.Gets the file that will be initially selected in
the file chooser dialog.Gets the folder that will be set as the
initial folder in the file chooser dialog.Gets the filename that will be initially selected.static int
boolean
getModal()
Returns whether the file chooser dialog blocks interaction
with the parent window while it is presented.static long
static TypeSystem.TypeSize
getTitle()
Returns the title that will be shown on the file chooser dialog.static long
static TypeSystem.TypeSize
void
open
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Presents a file chooser dialog to the user.openFinish
(AsyncResult result) Finishes the [method@Gtk.FileDialog.open] call.void
openMultiple
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Presents a file chooser dialog to the user.openMultipleFinish
(AsyncResult result) Finishes the [method@Gtk.FileDialog.open] call.void
openMultipleTextFiles
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Presents a file chooser dialog to the user.openMultipleTextFilesFinish
(AsyncResult result, Strs encoding) Finishes the [method@Gtk.FileDialog.open] call.void
openTextFile
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Initiates a file selection operation by presenting a file chooser
dialog to the user.openTextFileFinish
(AsyncResult result, Strs encoding) Finishes the [method@Gtk.FileDialog.open_text_file] call
and returns the resulting file and text encoding.void
save
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Presents a file chooser dialog to the user.saveFinish
(AsyncResult result) Finishes the [method@Gtk.FileDialog.save] call.void
saveTextFile
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Initiates a file save operation by presenting a file chooser
dialog to the user.saveTextFileFinish
(AsyncResult result, Strs encoding, Strs line_ending) Finishes the [method@Gtk.FileDialog.save_text_file] call
and returns the resulting file, text encoding and line endings.void
selectFolder
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Presents a file chooser dialog to the user.selectFolderFinish
(AsyncResult result) Finishes the [method@Gtk.FileDialog.select_folder] call.void
selectMultipleFolders
(Window parent, Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, Pointer user_data) Presents a file chooser dialog to the user.Finishes the [method@Gtk.FileDialog.select_multiple_folders] call.void
setAcceptLabel
(Str accept_label) Sets the label shown on the file chooser's accept button.void
setAcceptLabel
(String accept_label) Sets the label shown on the file chooser's accept button.void
setDefaultFilter
(FileFilter filter) Sets the filter that will be selected by default
in the file chooser dialog.void
setFilters
(ListModel filters) Sets the filters that will be offered to the user
in the file chooser dialog.void
setInitialFile
(File file) Sets the file that will be initially selected in
the file chooser dialog.void
setInitialFolder
(File folder) Sets the folder that will be set as the
initial folder in the file chooser dialog.void
setInitialName
(Str name) Sets the filename that will be initially selected.void
setInitialName
(String name) Sets the filename that will be initially selected.void
setModal
(boolean modal) Sets whether the file chooser dialog blocks interaction
with the parent window while it is presented.void
Sets the title that will be shown on the file chooser dialog.void
Sets the title that will be shown on the file chooser dialog.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
FileDialog
-
FileDialog
public FileDialog()Creates a new `GtkFileDialog` object.
-
-
Methodendetails
-
getClassHandler
-
getAcceptLabel
Retrieves the text used by the dialog on its accept button.- Gibt zurück:
- the label shown on the file chooser's accept button
-
getDefaultFilter
Gets the filter that will be selected by default
in the file chooser dialog.- Gibt zurück:
- the default filter
-
getFilters
Gets the filters that will be offered to the user
in the file chooser dialog.- Gibt zurück:
- the filters, as a list model of [class@Gtk.FileFilter]
-
getInitialFile
Gets the file that will be initially selected in
the file chooser dialog.- Gibt zurück:
- the file
-
getInitialFolder
Gets the folder that will be set as the
initial folder in the file chooser dialog.- Gibt zurück:
- the folder
-
getInitialName
Gets the filename that will be initially selected.- Gibt zurück:
- the name
-
getModal
public boolean getModal()Returns whether the file chooser dialog blocks interaction
with the parent window while it is presented.- Gibt zurück:
- true if the file chooser dialog is modal
-
getTitle
Returns the title that will be shown on the file chooser dialog.- Gibt zurück:
- the title
-
open
public void open(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Presents a file chooser dialog to the user.
The file chooser dialog will be set up to select a single file.
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent windowcancellable
- a cancellable to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
openFinish
Finishes the [method@Gtk.FileDialog.open] call.- Parameter:
result
- the result- Gibt zurück:
- the file that was selected
- Löst aus:
AllocationError
-
openMultiple
public void openMultiple(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Presents a file chooser dialog to the user.
The file chooser dialog will be set up to select multiple files.
The file chooser dialog will initially be opened in the directory
[property@Gtk.FileDialog:initial-folder].
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent windowcancellable
- a cancellable to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
openMultipleFinish
Finishes the [method@Gtk.FileDialog.open] call.- Parameter:
result
- the result- Gibt zurück:
- the files that were selected, as a list model of [iface@Gio.File]
- Löst aus:
AllocationError
-
openMultipleTextFiles
public void openMultipleTextFiles(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Presents a file chooser dialog to the user.
The file chooser dialog will be set up to select multiple files.
The file chooser dialog will initially be opened in the directory
[property@Gtk.FileDialog:initial-folder].
In contrast to [method@Gtk.FileDialog.open], this function
lets the user select the text encoding for the files, if possible.
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent windowcancellable
- a cancellable to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
openMultipleTextFilesFinish
public ListModel openMultipleTextFilesFinish(@Nonnull AsyncResult result, @Nonnull Strs encoding) throws AllocationError Finishes the [method@Gtk.FileDialog.open] call.- Parameter:
result
- the resultencoding
- return location for the text encoding to use- Gibt zurück:
- the files that were selected, as a list model of [iface@Gio.File]
- Löst aus:
AllocationError
-
openTextFile
public void openTextFile(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Initiates a file selection operation by presenting a file chooser
dialog to the user.
In contrast to [method@Gtk.FileDialog.open], this function
lets the user select the text encoding for the file, if possible.
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent `GtkWindow`cancellable
- a `GCancellable` to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
openTextFileFinish
public File openTextFileFinish(@Nonnull AsyncResult result, @Nonnull Strs encoding) throws AllocationError Finishes the [method@Gtk.FileDialog.open_text_file] call
and returns the resulting file and text encoding.
If the user has explicitly selected a text encoding to use
for the file, then @encoding will be set to a codeset name that
is suitable for passing to iconv_open(). Otherwise, it will
be `NULL`.- Parameter:
result
- a `GAsyncResult`encoding
- return location for the text encoding to use- Gibt zurück:
- the file that was selected
- Löst aus:
AllocationError
-
save
public void save(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Presents a file chooser dialog to the user.
The file chooser dialog will be save mode.
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent windowcancellable
- a cancellable to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
saveFinish
Finishes the [method@Gtk.FileDialog.save] call.- Parameter:
result
- the result- Gibt zurück:
- the file that was selected
- Löst aus:
AllocationError
-
saveTextFile
public void saveTextFile(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Initiates a file save operation by presenting a file chooser
dialog to the user.
In contrast to [method@Gtk.FileDialog.save], this function
lets the user select the text encoding and line endings for
the text file, if possible.
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent `GtkWindow`cancellable
- a `GCancellable` to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
saveTextFileFinish
public File saveTextFileFinish(@Nonnull AsyncResult result, @Nonnull Strs encoding, @Nonnull Strs line_ending) throws AllocationError Finishes the [method@Gtk.FileDialog.save_text_file] call
and returns the resulting file, text encoding and line endings.
If the user has explicitly selected a text encoding to use
for the file, then @encoding will be set to a codeset name that
is suitable for passing to iconv_open(). Otherwise, it will
be `NULL`.
The @line_ending will be set to one of "\n", "\r\n", "\r" or "",
where the latter means to preserve existing line endings.- Parameter:
result
- a `GAsyncResult`encoding
- return location for the text encoding to useline_ending
- return location for the line endings to use- Gibt zurück:
- the file that was selected. Otherwise, `NULL` is returned and @error is set
- Löst aus:
AllocationError
-
selectFolder
public void selectFolder(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Presents a file chooser dialog to the user.
The file chooser dialog will be set up to select a single folder.
If you pass @initial_folder, the file chooser dialog will initially
be opened in the parent directory of that folder, otherwise, it
will be in the directory [property@Gtk.FileDialog:initial-folder].
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent windowcancellable
- a cancellable to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
selectFolderFinish
Finishes the [method@Gtk.FileDialog.select_folder] call.- Parameter:
result
- the result- Gibt zurück:
- the folder that was selected
- Löst aus:
AllocationError
-
selectMultipleFolders
public void selectMultipleFolders(@Nullable Window parent, @Nullable Cancellable cancellable, FileDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Presents a file chooser dialog to the user.
The file chooser dialog will be set up to allow selecting
multiple folders.
The file chooser dialog will initially be opened in the
directory [property@Gtk.FileDialog:initial-folder].
The @callback will be called when the dialog is dismissed.- Parameter:
parent
- the parent windowcancellable
- a cancellable to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
selectMultipleFoldersFinish
Finishes the [method@Gtk.FileDialog.select_multiple_folders] call.- Parameter:
result
- the result- Gibt zurück:
- the folders that were selected, as a list model of [iface@Gio.File]
- Löst aus:
AllocationError
-
setAcceptLabel
Sets the label shown on the file chooser's accept button.
Leaving the accept label unset or setting it as `NULL` will
fall back to a default label, depending on what API is used
to launch the file dialog.- Parameter:
accept_label
- the new accept label
-
setAcceptLabel
Sets the label shown on the file chooser's accept button.
Leaving the accept label unset or setting it as `NULL` will
fall back to a default label, depending on what API is used
to launch the file dialog.- Parameter:
accept_label
- the new accept label
-
setDefaultFilter
Sets the filter that will be selected by default
in the file chooser dialog.
If set to `NULL`, the first item in [property@Gtk.FileDialog:filters]
will be used as the default filter. If that list is empty, the dialog
will be unfiltered.- Parameter:
filter
- the file filter
-
setFilters
Sets the filters that will be offered to the user
in the file chooser dialog.- Parameter:
filters
- a list model of [class@Gtk.FileFilter]
-
setInitialFile
Sets the file that will be initially selected in
the file chooser dialog.
This function is a shortcut for calling both
[method@Gtk.FileDialog.set_initial_folder] and
[method@Gtk.FileDialog.set_initial_name] with the
directory and name of @file, respectively.- Parameter:
file
- a file
-
setInitialFolder
Sets the folder that will be set as the
initial folder in the file chooser dialog.- Parameter:
folder
- a file
-
setInitialName
Sets the filename that will be initially selected.
For save dialogs, @name will usually be pre-entered into the
name field.
If a file with this name already exists in the directory set
via [property@Gtk.FileDialog:initial-folder], the dialog will
preselect it.- Parameter:
name
- a string
-
setInitialName
Sets the filename that will be initially selected.
For save dialogs, @name will usually be pre-entered into the
name field.
If a file with this name already exists in the directory set
via [property@Gtk.FileDialog:initial-folder], the dialog will
preselect it.- Parameter:
name
- a string
-
setModal
public void setModal(boolean modal) Sets whether the file chooser dialog blocks interaction
with the parent window while it is presented.- Parameter:
modal
- the new value
-
setTitle
Sets the title that will be shown on the file chooser dialog.- Parameter:
title
- the new title
-
setTitle
Sets the title that will be shown on the file chooser dialog.- Parameter:
title
- the new title
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-