Package org.apache.hop.ui.core.dialog
Class BaseDialog
- java.lang.Object
-
- org.eclipse.swt.widgets.Dialog
-
- org.apache.hop.ui.core.dialog.BaseDialog
-
- Direct Known Subclasses:
BaseMessageDialog,FieldSelectionDialog
public abstract class BaseDialog extends org.eclipse.swt.widgets.DialogA base dialog class containing a body and a configurable button panel.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.eclipse.swt.widgets.Listener>buttonsstatic intELEMENT_SPACINGstatic StringHOP_USE_NATIVE_FILE_DIALOGstatic intLABEL_SPACINGstatic intMARGIN_SIZEstatic intMEDIUM_FIELDstatic intMEDIUM_SMALL_FIELDstatic StringNO_DEFAULT_HANDLERprotected PropsUipropsprotected org.eclipse.swt.widgets.Shellshellstatic intSHELL_WIDTH_OFFSETstatic intSMALL_FIELDprotected Stringtitlestatic intVAR_ICON_HEIGHTDeprecated.static intVAR_ICON_WIDTHDeprecated.protected intwidth
-
Constructor Summary
Constructors Constructor Description BaseDialog(org.eclipse.swt.widgets.Shell shell)BaseDialog(org.eclipse.swt.widgets.Shell shell, String title, int width)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static voidaddDefaultListeners(org.eclipse.swt.widgets.Composite composite, Consumer<Void> okConsumer)protected abstract org.eclipse.swt.widgets.ControlbuildBody()Returns the last element in the body - the one to which the buttons should be attached.protected voidbuildFooter(org.eclipse.swt.widgets.Control anchorElement)static voiddefaultShellHandling(org.eclipse.swt.widgets.Shell shell, Consumer<Void> okConsumer, Consumer<Void> cancelConsumer)Handle the shell specified until the OK (button) is consumed.voiddispose()intopen()static intopenMessageBox(org.eclipse.swt.widgets.Shell parent, String title, String message, int flags)static StringpresentDirectoryDialog(org.eclipse.swt.widgets.Shell shell, IVariables variables)static StringpresentDirectoryDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, String message, IVariables variables)static StringpresentDirectoryDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables)static StringpresentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, TextVar textVar, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(org.eclipse.swt.widgets.Shell shell, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, String[] filterExtensions, String[] filterNames, boolean folderAndFile)static StringpresentFileDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)voidsetButtons(Map<String,org.eclipse.swt.widgets.Listener> buttons)static voidsetDefaultIconsOnTabs(org.eclipse.swt.widgets.Composite composite)voidsetFooterTopPadding(int footerTopPadding)
-
-
-
Field Detail
-
NO_DEFAULT_HANDLER
public static final String NO_DEFAULT_HANDLER
- See Also:
- Constant Field Values
-
HOP_USE_NATIVE_FILE_DIALOG
@Variable(scope=APPLICATION, value="N", description="Set this value to \'Y\' if you want to use the system file open/save dialog when browsing files.") public static final String HOP_USE_NATIVE_FILE_DIALOG
- See Also:
- Constant Field Values
-
MARGIN_SIZE
public static final int MARGIN_SIZE
- See Also:
- Constant Field Values
-
LABEL_SPACING
public static final int LABEL_SPACING
- See Also:
- Constant Field Values
-
ELEMENT_SPACING
public static final int ELEMENT_SPACING
- See Also:
- Constant Field Values
-
MEDIUM_FIELD
public static final int MEDIUM_FIELD
- See Also:
- Constant Field Values
-
MEDIUM_SMALL_FIELD
public static final int MEDIUM_SMALL_FIELD
- See Also:
- Constant Field Values
-
SMALL_FIELD
public static final int SMALL_FIELD
- See Also:
- Constant Field Values
-
SHELL_WIDTH_OFFSET
public static final int SHELL_WIDTH_OFFSET
- See Also:
- Constant Field Values
-
VAR_ICON_WIDTH
@Deprecated public static final int VAR_ICON_WIDTH
Deprecated.
-
VAR_ICON_HEIGHT
@Deprecated public static final int VAR_ICON_HEIGHT
Deprecated.
-
shell
protected org.eclipse.swt.widgets.Shell shell
-
props
protected PropsUi props
-
width
protected int width
-
title
protected String title
-
-
Constructor Detail
-
BaseDialog
public BaseDialog(org.eclipse.swt.widgets.Shell shell)
-
BaseDialog
public BaseDialog(org.eclipse.swt.widgets.Shell shell, String title, int width)
-
-
Method Detail
-
presentFileDialog
public static final String presentFileDialog(org.eclipse.swt.widgets.Shell shell, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, TextVar textVar, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentFileDialog
public static final String presentFileDialog(boolean save, org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables, org.apache.commons.vfs2.FileObject fileObject, String[] filterExtensions, String[] filterNames, boolean folderAndFile)
-
presentDirectoryDialog
public static String presentDirectoryDialog(org.eclipse.swt.widgets.Shell shell, IVariables variables)
-
presentDirectoryDialog
public static String presentDirectoryDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, IVariables variables)
-
presentDirectoryDialog
public static String presentDirectoryDialog(org.eclipse.swt.widgets.Shell shell, TextVar textVar, String message, IVariables variables)
-
buildBody
protected abstract org.eclipse.swt.widgets.Control buildBody()
Returns the last element in the body - the one to which the buttons should be attached.- Returns:
-
open
public int open()
-
buildFooter
protected void buildFooter(org.eclipse.swt.widgets.Control anchorElement)
-
setFooterTopPadding
public void setFooterTopPadding(int footerTopPadding)
-
dispose
public void dispose()
-
defaultShellHandling
public static void defaultShellHandling(org.eclipse.swt.widgets.Shell shell, Consumer<Void> okConsumer, Consumer<Void> cancelConsumer)Handle the shell specified until the OK (button) is consumed. Set a default icon on the shell, add default selection handlers on fields. Set the appropriate size for the shell. If you have widgets on which you don't want to have this default selection handler to okConsumer, do:widget.setData(NO_DEFAULT_HANDLER, true)
- Parameters:
shell- The shell to handle.okConsumer- What to do when the dialog information needs to be retained after closing.cancelConsumer- What to do when the dialog is cancelled.
-
setDefaultIconsOnTabs
public static void setDefaultIconsOnTabs(org.eclipse.swt.widgets.Composite composite)
-
addDefaultListeners
public static void addDefaultListeners(org.eclipse.swt.widgets.Composite composite, Consumer<Void> okConsumer)
-
-