Class CommonPictureFileDialogBuilder


  • public class CommonPictureFileDialogBuilder
    extends Object
    Build open or save file dialog for select picture for CommonPicture
    • Field Detail

      • ALL_OPEN_PICTURE_EXTENSION_SET

        public static final Set<String> ALL_OPEN_PICTURE_EXTENSION_SET
        String set of all picture extensions available for common picture
    • Constructor Detail

      • CommonPictureFileDialogBuilder

        public CommonPictureFileDialogBuilder()
    • Method Detail

      • configureOpenDialogWithZip

        public CommonPictureFileDialogBuilder configureOpenDialogWithZip()
        Configure open file dialog with all picture extension filters include zip

        Add all filter names and extensions, set dialog in open mode

        Returns:
        configured builder, never null
      • configureOpenDialogWithoutZip

        public CommonPictureFileDialogBuilder configureOpenDialogWithoutZip()
        Configure open file dialog with all picture extension filters exclude zip

        Add all filter names and extensions without 'zip', set dialog in open mode

        Returns:
        configured builder, never null
      • shell

        public CommonPictureFileDialogBuilder shell​(org.eclipse.swt.widgets.Shell shell)
        Determine dialog shell
        Parameters:
        shell - a shell which will be the parent of the new instance, cannot be null
        Returns:
        configured builder, never null
        See Also:
        FileDialog
      • style

        public CommonPictureFileDialogBuilder style​(int style)
        Determine dialog style
        Parameters:
        style - the style of dialog to construct, cannot be null
        Returns:
        configured builder, never null
        See Also:
        FileDialog
      • text

        public CommonPictureFileDialogBuilder text​(String text)
        Determine dialog title text
        Parameters:
        text - the new text, cannot be null
        Returns:
        configured builder, never null
        See Also:
        Dialog.setText(String)
      • fileName

        public CommonPictureFileDialogBuilder fileName​(String fileName)
        Determine the initial filename which the dialog will select by default
        Parameters:
        fileName - the file name, cannot be null
        Returns:
        configured builder, never null
        See Also:
        FileDialog.setFileName(String)
      • filterNames

        public CommonPictureFileDialogBuilder filterNames​(String[] filterNames,
                                                          String[] filterExtensions)
        Determine arrays of the names that describe the filter extensions
        Parameters:
        filterNames - the list of filter names, or null for no filter names
        filterExtensions - the the list of file extension filter, cannot be null
        Returns:
        configured builder, never null
        See Also:
        FileDialog.setFilterNames(String[]), FileDialog.setFilterExtensions(String[])
      • build

        public org.eclipse.swt.widgets.FileDialog build()
        Build configured file dialog
        Returns:
        instance of FileDialog, never null