public class Dialog
ImplementsAbstractDialog, Animation, Editable, Iterable<Component>, StyleListener, TopLevelContainer
Known subtypesProgress
A dialog is a form that occupies a part of the screen and appears as a modal entity to the developer. Dialogs allow us to prompt users for information and rely on the information being available on the next line after the show method.
Modality indicates that a dialog will block the calling thread even if the
calling thread is the EDT. Notice that a dialog will not release the block
until dispose is called even if show() from another form is called! Events are still performed thanks
to the com.codename1.ui.Display#invokeAndBlock(java.lang.Runnable) capability of the
Display class.
To determine the size of the dialog use the show method that accepts 4 integer values, notice that these values accept margin from the four sides rather than x, y, width and height values!
It’s important to style a Dialog using Dialog#getDialogStyle() or
Dialog#setDialogUIID(java.lang.String) methods rather than styling the dialog object directly.
The Dialog class also includes support for popup dialog which is a dialog type that is positioned
next to a component or screen area and points an arrow at that location.
Static Dialog.show(...) APIs can optionally use InteractionDialog under the hood by setting
Dialog#setDefaultInteractionDialogMode(boolean) or the theme constant defaultInteractionDialogModeBool.
Typical dialog usage looks like this:
final Button show = new Button("Show Dialog");
final Button showPopup = new Button("Show Popup");
cnt.add(show).add(showPopup);
show.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
Dialog.show("Dialog Title", "This is the dialog body, it can contain anything...", "OK", "Cancel");
}
});
showPopup.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
Dialog d = new Dialog("Popup Title");
TextArea popupBody = new TextArea("This is the body of the popup", 3, 10);
popupBody.setUIID("PopupBody");
popupBody.setEditable(false);
d.setLayout(new BorderLayout());
d.add(BorderLayout.CENTER, popupBody);
d.showPopupDialog(showPopup);
}
});
See this sample for showing a dialog at the bottom of the screen:
Dialog dlg = new Dialog("At Bottom");
dlg.setLayout(new BorderLayout());
// span label accepts the text and the UIID for the dialog body
dlg.add(new SpanLabel("Dialog Body text", "DialogBody"));
int h = Display.getInstance().getDisplayHeight();
dlg.setDisposeWhenPointerOutOfBounds(true);
dlg.show(h /8 * 7, 0, 0, 0);
Fields
public static final int TYPE_NONE = 0 | Constant indicating the type of alert to indicate the sound to play or icon if none are explicitly set |
public static final int TYPE_ALARM = 1 | Constant indicating the type of alert to indicate the sound to play or icon if none are explicitly set |
public static final int TYPE_CONFIRMATION = 2 | Constant indicating the type of alert to indicate the sound to play or icon if none are explicitly set |
public static final int TYPE_ERROR = 3 | Constant indicating the type of alert to indicate the sound to play or icon if none are explicitly set |
public static final int TYPE_INFO = 4 | Constant indicating the type of alert to indicate the sound to play or icon if none are explicitly set |
public static final int TYPE_WARNING = 5 | Constant indicating the type of alert to indicate the sound to play or icon if none are explicitly set |
Constructors
public Dialog(String title) | Constructs a Dialog with a title |
public Dialog(String title, Layout lm) | Constructs a Dialog with a title |
public Dialog() | Constructs a Dialog |
public Dialog(Layout lm) | Constructs a Dialog with a layout |
Methods
public static boolean isDefaultDisposeWhenPointerOutOfBounds() | The default pointer out of bounds dispose behavior, notice that this only applies to dialogs and not popup dialogs where this is always true by default |
public static void setDefaultDisposeWhenPointerOutOfBounds(boolean aDefaultDisposeWhenPointerOutOfBounds) | The default pointer out of bounds dispose behavior, notice that this only applies to dialogs and not popup dialogs where this is always true by default |
public static boolean show(String title, String text, int type, Image icon, String okText, String cancelText) | Shows a modal prompt dialog with the given title and text. |
public static boolean show(String title, String text, int type, Image icon, String okText, String cancelText, long timeout) | Shows a modal prompt dialog with the given title and text. |
public static Command show(String title, String text, Command[] cmds, int type, Image icon, long timeout) | Shows a modal prompt dialog with the given title and text. |
public static Command show(String title, String text, Command defaultCommand, Command[] cmds, int type, Image icon, long timeout) | Shows a modal prompt dialog with the given title and text. |
public static Command show(String title, String text, Command[] cmds, int type, Image icon, long timeout, Transition transition) | Shows a modal prompt dialog with the given title and text. |
public static Command show(String title, String text, Command defaultCommand, Command[] cmds, int type, Image icon, long timeout, Transition transition) | Shows a modal prompt dialog with the given title and text. |
public static boolean show(String title, String text, String okText, String cancelText) | Shows a modal prompt dialog with the given title and text. |
public static Command show(String title, Component body, Command... cmds) | Shows a modal dialog with the given component as its “body” placed in the center. |
public static Command show(String title, String body, Command... cmds) | Shows a modal dialog with the given component as its “body” placed in the center. |
public static Command show(String title, Component body, Command[] cmds, int type, Image icon) | Shows a modal dialog with the given component as its “body” placed in the center. |
public static Command show(String title, Component body, Command[] cmds, int type, Image icon, long timeout) | Shows a modal dialog with the given component as its “body” placed in the center. |
public static Command show(String title, Component body, Command[] cmds, int type, Image icon, long timeout, Transition transition) | Shows a modal dialog with the given component as its “body” placed in the center. |
public static Command show(String title, Component body, Command defaultCommand, Command[] cmds, int type, Image icon, long timeout, Transition transition) | Shows a modal dialog with the given component as its “body” placed in the center. |
public static String getDefaultDialogPosition() | Default screen orientation position for the upcoming dialog. |
public static void setDefaultDialogPosition(String p) | Default screen orientation position for the upcoming dialog. |
public static int getDefaultDialogType() | The default type for dialogs |
public static void setDefaultDialogType(int d) | The default type for dialogs |
public static boolean isAutoAdjustDialogSize() | Indicates whether Codename One should try to automatically adjust a showing dialog size when a screen size change event occurs |
public static void setAutoAdjustDialogSize(boolean a) | Indicates whether Codename One should try to automatically adjust a showing dialog size when a screen size change event occurs |
public static boolean isDisableStaticDialogScrolling() | Allows a developer to indicate his interest that the dialog should no longer scroll on its own but rather rely on the scrolling properties of internal scrollable containers. |
public static void setDisableStaticDialogScrolling(boolean d) | Allows a developer to indicate his interest that the dialog should no longer scroll on its own but rather rely on the scrolling properties of internal scrollable containers. |
public static boolean isCommandsAsButtons() | Places commands as buttons at the bottom of the standard static dialogs rather than as softbuttons. |
public static void setCommandsAsButtons(boolean c) | Places commands as buttons at the bottom of the standard static dialogs rather than as softbuttons. |
public static float getDefaultBlurBackgroundRadius() | Dialog background can be blurred using a Gaussian blur effect, this sets the radius of the Gaussian blur. |
public static void setDefaultBlurBackgroundRadius(float aDefaultBlurBackgroundRadius) | Dialog background can be blurred using a Gaussian blur effect, this sets the radius of the Gaussian blur. |
public static boolean isDefaultTitleCentered() | Indicates whether newly-created dialogs place their title in the absolute center, with the body below it. |
public static void setDefaultTitleCentered(boolean defaultTitleCentered) | Sets whether newly-created Dialog and InteractionDialog instances place their title in the absolute center, with the body below it. |
public static boolean isDefaultNativeWindowMode() | Whether newly created dialogs are backed by a real operating system window on desktop platforms. |
public static void setDefaultNativeWindowMode(boolean nativeWindowMode) | Sets whether newly created dialogs are backed by a real operating system window on desktop platforms. |
public boolean isNativeWindowMode() | Whether this dialog is backed by a real operating system window. |
public void setNativeWindowMode(boolean nativeWindowMode) | Sets whether this dialog is backed by a real operating system window. |
public Window getNativeWindow() | The window backing this dialog while it is showing. |
protected void initNativeWindow(Window w) | Called once the window backing this dialog has been configured and before it is shown, so an application can adjust it – make it resizable, give it an icon, take its decoration away. |
public static boolean isDefaultInteractionDialogMode() | Indicates whether newly-created dialogs should use InteractionDialog under the hood. |
public static void setDefaultInteractionDialogMode(boolean defaultInteractionDialogMode) | Indicates whether newly-created dialogs should use InteractionDialog under the hood. |
public boolean isInteractionDialogMode() | Indicates whether this dialog should use InteractionDialog under the hood. |
public void setInteractionDialogMode(boolean interactionDialogMode) | Indicates whether this dialog should use InteractionDialog under the hood. |
public void setPreviousForm(Form previousForm) | When the dialog is disposed this form will show. |
protected final void initGlobalToolbar() | Overriden to disable the toolbar in dialogs |
public Container getContentPane() | This method returns the Content pane instance |
public Layout getLayout() | Returns the layout manager of the form’s content pane. |
public final void setLayout(Layout layout) | Sets the layout manager responsible for arranging this container |
public String getTitle() | Returns the Form title text |
public final void setTitle(String title) | Sets the Form title to the given text |
public final void addComponent(Component cmp) | Adds Component to the Form’s Content Pane |
public void addComponent(Object constraints, Component cmp) | Adds a Component to the Container |
public void addComponent(int index, Object constraints, Component cmp) | Adds a Component to the Container |
public void addComponent(int index, Component cmp) | Adds Component to the Form’s Content Pane |
public void removeAll() | Removes all Components from the Content Pane |
public void removeComponent(Component cmp) | Removes a component from the Form’s Content Pane |
public void refreshTheme(boolean merge) | Refreshing the theme reinstalls the menu bar, and installing it moves the form’s title component into the title area. |
public Label getTitleComponent() | Allows modifying the title attributes beyond style (e.g. setting icon/alignment etc.) |
public void setTitleComponent(Label title) | Allows replacing the title with a different title component, thus allowing developers to create more elaborate title objects. |
public boolean isTitleCentered() | Returns whether this dialog places its title in the absolute center with the body below it. |
public void setTitleCentered(boolean titleCentered) | Places the title in the absolute center with the body below it. |
public Style getTitleStyle() | Returns the style of the title |
public Container getDialogComponent() | Returns the container that actually implements the dialog positioning. |
public void setTitleComponent(Label title, Transition t) | Allows replacing the title with a different title component, thus allowing developers to create more elaborate title objects. |
public String getDialogUIID() | Returns the uiid of the dialog |
public void setDialogUIID(String uiid) | Simple setter to set the Dialog uiid |
public Style getDialogStyle() | Simple getter to get the Dialog Style |
public void setDialogStyle(Style style) | Simple setter to set the Dialog Style |
protected void initLaf(UIManager uim) | Initialize the default transition for the dialogs overriding the forms transition |
public Command show(int top, int bottom, int left, int right, boolean includeTitle) | Deprecated This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. |
public Command show(int top, int bottom, int left, int right) | This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. |
public Command show(int top, int bottom, int left, int right, boolean includeTitle, boolean modal) | Deprecated This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. |
public Command showAtPosition(int top, int bottom, int left, int right, boolean modal) | This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. |
public void setTimeout(long time) | Indicates the time (in milliseconds) afterwhich the dialog will be disposed implicitly |
public void setTransitions(Transition transition) | Sets in/out transition for dialogs that support transitions. |
public void configureCommands(Command[] cmds, boolean commandsAsButtons) | Configures commands for the dialog UI. |
protected void autoAdjust(int w, int h) | Auto adjust size of the dialog. |
public void placeButtonCommands(Command[] cmds) | Deprecated Places the given commands in the dialog command area, this is very useful for touch devices. |
public void keyReleased(int keyCode) | If this Component is focused, the key released event will call this method |
protected void onShow() | Allows subclasses to bind functionality that occurs when a specific form or dialog appears on the screen |
public void showBack() | Displays the current form on the screen, this version of the method is useful for “back” navigation since it reverses the direction of the transition. |
public void setScrollable(boolean scrollable) | The equivalent of calling both setScrollableY and setScrollableX |
public void show() | The default version of show modal shows the dialog occupying the center portion of the screen. |
public void showModeless() | Shows a modeless dialog which is useful for some simpler use cases such as progress indication etc… |
public void setTopLevelHost(TopLevelContainer host) | The top level this dialog appears on when it is shown. |
public TopLevelContainer getTopLevelHost() | Returns the top level set with #setTopLevelHost(TopLevelContainer). |
public void addCommand(Command cmd, int offset) | Hands menu style commands to the window so the platform can put them wherever it shows a window’s commands. |
public void removeCommand(Command cmd) | Removes the command from the menu bar softkeys |
public void removeAllCommands() | Clear menu commands from the menu bar |
public Command showPopupDialog(Component c) | A popup dialog is shown with the context of a component and its selection, it is disposed seamlessly if the back button is pressed or if the user touches outside its bounds. |
public Command showPopupDialog(Rectangle rect) | A popup dialog is shown with the context of a component and its selection, it is disposed seamlessly if the back button is pressed or if the user touches outside its bounds. |
public Command showPacked(String position, boolean modal) | Convenience method to show a dialog sized to match its content. |
public Command showStretched(String position, boolean modal) | Convenience method to show a dialog stretched to one of the sides |
public Command showStetched(String position, boolean modal) | Deprecated Convenience method to show a dialog stretched to one of the sides |
public Dimension getDialogPreferredSize() | Returns the preferred size of the dialog, this allows developers to position a dialog manually in arbitrary positions. |
public void dispose() | Closes the current form and returns to the previous form, releasing the EDT in the process |
public Command showDialog() | Shows a modal dialog and returns the command pressed within the modal dialog |
protected void actionCommand(Command cmd) | Invoked to allow subclasses of form to handle a command from one point rather than implementing many command instances |
public boolean animate() | Allows the animation to reduce “repaint” calls when it returns false. |
public boolean isAutoDispose() | Determines whether the execution of a command on this dialog implicitly disposes the dialog. |
public final void setAutoDispose(boolean autoDispose) | Determines whether the execution of a command on this dialog implicitly disposes the dialog. |
public int getDialogType() | The type of the dialog can be one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM |
public void setDialogType(int dialogType) | The type of the dialog can be one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM |
public boolean isDisposeWhenPointerOutOfBounds() | This flag indicates if the dialog should be disposed if a pointer released event occurred out of the dialog content. |
public final void setDisposeWhenPointerOutOfBounds(boolean disposeWhenPointerOutOfBounds) | This flag indicates if the dialog should be disposed if a pointer released event occurred out of the dialog content. |
public void pointerReleased(int x, int y) | If this Component is focused, the pointer released event will call this method |
public void pointerPressed(int x, int y) | If this Component is focused, the pointer pressed event will call this method |
public boolean wasDisposedDueToOutOfBoundsTouch() | Returns true if a dialog that was disposed did it because of a pointer out of bounds |
public String getDialogPosition() | Screen orientation position for the upcoming dialog. |
public void setDialogPosition(String dialogPosition) | Screen orientation position for the upcoming dialog. |
public void growOrShrink() | Allows a dialog component to grow or shrink to its new preferred size |
public Boolean getPopupDirectionBiasPortrait() | Indicates if we want to enforce directional bias for the popup dialog. |
public void setPopupDirectionBiasPortrait(Boolean popupDirectionBiasPortrait) | Indicates if we want to enforce directional bias for the popup dialog. |
public boolean wasDisposedDueToRotation() | Returns true if the dialog was disposed automatically due to device rotation |
public float getBlurBackgroundRadius() | Dialog background can be blurred using a Gaussian blur effect, this sets the radius of the Gaussian blur. |
public void setBlurBackgroundRadius(float blurBackgroundRadius) | Dialog background can be blurred using a Gaussian blur effect, this sets the radius of the Gaussian blur. |
public void setUIIDByPopupPosition(boolean b) | Allows to use the UIIDs “PopupContentPaneDownwards”, “PopupContentPaneUpwards”, “PopupContentPaneRight”, “PopupContentPaneLeft” (instead of the default UIID “PopupContentPane”) to style the PopupDialog more accurately based on the position of the dialog popup compared to the context component. |
Inherited nested types
From Form
Inherited fields
From Form
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
Inherited methods
From Form
setAllowEnableLayoutOnPaint, addPasteListener, removePasteListener, dispatchPaste, getTextSelection, isEnableCursors, setEnableCursors, getSourceCommand, setSourceCommand, getCurrentInputDevice, setCurrentInputDevice, setOverrideInvisibleAreaUnderVKB, getInvisibleAreaUnderVKB, getAnimationManager, isFormBottomPaddingEditingMode, setFormBottomPaddingEditingMode, getSafeArea, shouldPaintStatusBar, createStatusBar, isAlwaysTensile, setAlwaysTensile, grabAnimationLock, releaseAnimationLock, findCurrentlyEditingComponent, getTitleArea, getUIManager, setUIManager, addShowListener, removeShowListener, removeAllShowListeners, addOrientationListener, removeOrientationListener, addSizeChangedListener, removeSizeChangedListener, hideNotify, showNotify, sizeChanged, setSafeAreaChanged, isDragRegion, getDragRegionStatus, getGlassPane, setGlassPane, addKeyListener, removeKeyListener, removeGameKeyListener, addGameKeyListener, getSoftButtonCount, getSoftButton, getMenuStyle, setTitleStyle, getDefaultCommand, setDefaultCommand, getClearCommand, setClearCommand, setBackCommand, getBackCommand, setBackCommand, setPopGuard, getPopGuard, checkPopGuard, asContainer, getLayeredPane, getLayeredPane, getLayeredPane, getFormLayeredPane, getLayeredPaneIfExists, getFormLayeredPaneIfExists, setBgImage, stopEditing, isEditing, replace, replaceAndWait, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, isTopLevelShowing, hasMedia, registerAnimated, onRegisterAnimated, deregisterAnimated, getSideGap, paintScrollbars, paintBackground, getTransitionInAnimator, setTransitionInAnimator, getTransitionOutAnimator, setTransitionOutAnimator, addCommandListener, removeCommandListener, dispatchCommand, addPointerPressedListener, removePointerPressedListener, addPointerDraggedListener, removePointerDraggedListener, addPointerReleasedListener, removePointerReleasedListener, addLongPressListener, removeLongPressListener, isSmoothScrolling, setSmoothScrolling, getScrollAnimationSpeed, setScrollAnimationSpeed, onShowCompleted, getComponentForm, getTopLevelContainer, getFocused, setFocused, longKeyPress, longPointerPress, shouldSendPointerReleaseToOtherForm, getNextComponent, getPreviousComponent, getTabIterator, keyPressed, isMinimizeOnBack, setMinimizeOnBack, keyRepeated, resumeDragAfterScrolling, addComponentAwaitingRelease, removeComponentAwaitingRelease, clearComponentsAwaitingRelease, pointerDragged, pointerDragged, pointerHoverReleased, pointerHoverPressed, pointerHover, isSingleFocusMode, isScrollVisible, setScrollVisible, getComponentIndex, getCommandCount, getCommand, addCommand, findNextFocusVertical, findNextFocusHorizontal, isCyclicFocus, setCyclicFocus, scrollComponentToVisible, setMenuCellRenderer, setRTL, paint, isScrollable, isScrollableX, setScrollableX, isScrollableY, setScrollableY, setVisible, getTintColor, setTintColor, setMenuTransitions, paramString, getMenuBar, setMenuBar, setToolBar, getToolbar, setToolbar, isFocusScrolling, setFocusScrolling, getPropertyNames, getPropertyTypes, getPropertyTypeNames, getPropertyValue, setPropertyValue, getEditOnShow, setEditOnShow
From Container
encloseIn, encloseIn, isSurface, add, addAll, add, add, add, add, add, getLeadComponent, setLeadComponent, getLeadParent, invalidate, setShouldLayout, setShouldCalcPreferredSize, getLayoutWidth, getLayoutHeight, applyRTL, constrainWidthWhenScrollable, constrainHeightWhenScrollable, replaceAndWait, replace, replaceAndWait, createReplaceTransition, isEnabled, setEnabled, cancelRepaints, flushReplace, revalidateWithAnimationSafety, revalidate, revalidateLater, forceRevalidate, clearClientProperties, paintGlass, layoutContainer, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, contains, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, calcPreferredSize, getBottomGap, setCellRenderer, getScrollIncrement, setScrollIncrement, findFirstFocusable, dragInitiated, fireClicked, isSelectableInteraction, getGridPosY, paintComponentBackground, getGridPosX, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayoutFadeAndWait, createAnimateLayoutFade, updateTabIndices, createAnimateLayout, drop, createAnimateMotion, morph, morphAndWait, createAnimateUnlayout, getChildrenAsList, iterator, iterator
From Component
setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, getClientProperty, stripMarginAndPadding, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, repaint, repaint, registerForAnimation, deregisterFromAnimation, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, stopScrollMomentum, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, getDragImage, getDragTransparency, setDragTransparency, toImage, drawDraggedImage, draggingOver, dragEnter, dragExit, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removeDragFinishedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, setIsScrollVisible, startEditingAsync, isEditable, laidOut, deinitialize, initComponent, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, isTactileTouch, isTactileTouch, setTactileTouch, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip
Field details
TYPE_NONE
public static final int TYPE_NONE = 0TYPE_ALARM
public static final int TYPE_ALARM = 1TYPE_CONFIRMATION
public static final int TYPE_CONFIRMATION = 2TYPE_ERROR
public static final int TYPE_ERROR = 3TYPE_INFO
public static final int TYPE_INFO = 4TYPE_WARNING
public static final int TYPE_WARNING = 5Constructor details
Dialog
public Dialog(String title)Parameters
titleString- the title of the dialog
Dialog
public Dialog(String title, Layout lm)Parameters
titleString- the title of the dialog
lmLayout- the layout for the dialog
Dialog
public Dialog()Dialog
public Dialog(Layout lm)Parameters
lmLayout- the layout manager
Method details
isDefaultDisposeWhenPointerOutOfBounds
public static boolean isDefaultDisposeWhenPointerOutOfBounds()Returns
setDefaultDisposeWhenPointerOutOfBounds
public static void setDefaultDisposeWhenPointerOutOfBounds(boolean aDefaultDisposeWhenPointerOutOfBounds)Parameters
aDefaultDisposeWhenPointerOutOfBoundsboolean- the defaultDisposeWhenPointerOutOfBounds to set
show
public static boolean show(String title, String text, int type, Image icon, String okText, String cancelText)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
okTextString- the text to appear in the command dismissing the dialog
cancelTextString- optionally null for a text to appear in the cancel command for canceling the dialog
Returns
show
public static boolean show(String title, String text, int type, Image icon, String okText, String cancelText, long timeout)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
okTextString- the text to appear in the command dismissing the dialog
cancelTextString- optionally null for a text to appear in the cancel command for canceling the dialog
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
Returns
show
public static Command show(String title, String text, Command[] cmds, int type, Image icon, long timeout)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
Returns
show
public static Command show(String title, String text, Command defaultCommand, Command[] cmds, int type, Image icon, long timeout)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
defaultCommandCommand- command to be assigned as the default command or null
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
Returns
show
public static Command show(String title, String text, Command[] cmds, int type, Image icon, long timeout, Transition transition)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
transitionTransition- the transition installed when the dialog enters/leaves
Returns
show
public static Command show(String title, String text, Command defaultCommand, Command[] cmds, int type, Image icon, long timeout, Transition transition)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
defaultCommandCommand- command to be assigned as the default command or null
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
transitionTransition- the transition installed when the dialog enters/leaves
Returns
show
public static boolean show(String title, String text, String okText, String cancelText)Parameters
titleString- The title for the dialog optionally null;
textString- the text displayed in the dialog
okTextString- the text to appear in the command dismissing the dialog
cancelTextString- optionally null for a text to appear in the cancel command for canceling the dialog
Returns
show
public static Command show(String title, Component body, Command... cmds)Parameters
titleString- title for the dialog
bodyComponent- component placed in the center of the dialog
cmdsCommand...- commands that are added to the form any click on any command will dispose the form
Returns
show
public static Command show(String title, String body, Command... cmds)Parameters
titleString- title for the dialog
bodyString- text placed in the center of the dialog
cmdsCommand...- commands that are added to the form any click on any command will dispose the form
Returns
show
public static Command show(String title, Component body, Command[] cmds, int type, Image icon)Parameters
titleString- title for the dialog
bodyComponent- component placed in the center of the dialog
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
Returns
show
public static Command show(String title, Component body, Command[] cmds, int type, Image icon, long timeout)Parameters
titleString- title for the dialog
bodyComponent- component placed in the center of the dialog
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
Returns
show
public static Command show(String title, Component body, Command[] cmds, int type, Image icon, long timeout, Transition transition)Parameters
titleString- title for the dialog
bodyComponent- component placed in the center of the dialog
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 infinite time is used
transitionTransition- the transition installed when the dialog enters/leaves
Returns
show
public static Command show(String title, Component body, Command defaultCommand, Command[] cmds, int type, Image icon, long timeout, Transition transition)Parameters
titleString- title for the dialog
bodyComponent- component placed in the center of the dialog
defaultCommandCommand- command to be assigned as the default command or null
cmdsCommand[]- commands that are added to the form any click on any command will dispose the form
typeint- the type of the alert one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
iconImage- the icon for the dialog, can be null
timeoutlong- a timeout after which null would be returned if timeout is 0 inifinite time is used
transitionTransition- the transition installed when the dialog enters/leaves
Returns
getDefaultDialogPosition
public static String getDefaultDialogPosition()Returns
setDefaultDialogPosition
public static void setDefaultDialogPosition(String p)Parameters
pString- for dialogs on the sceen using BorderLayout orientation tags
getDefaultDialogType
public static int getDefaultDialogType()Returns
setDefaultDialogType
public static void setDefaultDialogType(int d)Parameters
dint- the default type for the dialog
isAutoAdjustDialogSize
public static boolean isAutoAdjustDialogSize()Returns
setAutoAdjustDialogSize
public static void setAutoAdjustDialogSize(boolean a)Parameters
aboolean- true to indicate that Codename One should make a “best effort” to resize the dialog
isDisableStaticDialogScrolling
public static boolean isDisableStaticDialogScrolling()Returns
setDisableStaticDialogScrolling
public static void setDisableStaticDialogScrolling(boolean d)Parameters
dboolean- indicates whether scrolling should be active or not
isCommandsAsButtons
public static boolean isCommandsAsButtons()Returns
setCommandsAsButtons
public static void setCommandsAsButtons(boolean c)Parameters
cboolean- true to place commands as buttons and not as softbutton keys
getDefaultBlurBackgroundRadius
public static float getDefaultBlurBackgroundRadius()Returns
setDefaultBlurBackgroundRadius
public static void setDefaultBlurBackgroundRadius(float aDefaultBlurBackgroundRadius)dialogBlurRadiusIntParameters
aDefaultBlurBackgroundRadiusfloat- the defaultBlurBackgroundRadius to set
isDefaultTitleCentered
public static boolean isDefaultTitleCentered()dialogTitleCenterBool theme constant.Returns
setDefaultTitleCentered
public static void setDefaultTitleCentered(boolean defaultTitleCentered)Dialog and InteractionDialog instances place
their title in the absolute center, with the body below it.Parameters
defaultTitleCenteredboolean- true to use the centered title layout by default
isDefaultNativeWindowMode
public static boolean isDefaultNativeWindowMode()Whether newly created dialogs are backed by a real operating system window on desktop platforms.
This default can be configured globally with the theme constant
defaultNativeWindowModeBool.
Returns
setDefaultNativeWindowMode
public static void setDefaultNativeWindowMode(boolean nativeWindowMode)Sets whether newly created dialogs are backed by a real operating system window on desktop platforms.
This overrides the theme constant defaultNativeWindowModeBool for the rest of
the application’s life.
Parameters
nativeWindowModeboolean- true to open new dialogs in their own window
isNativeWindowMode
public boolean isNativeWindowMode()Whether this dialog is backed by a real operating system window.
Resolved when the dialog is shown, in this order: what
#setNativeWindowMode(boolean) was told, else
#isDefaultNativeWindowMode(), else the theme constant behind it. A platform
with no windowing system ignores all three and shows the dialog the ordinary
way – the setting is a preference about how to render, not a contract, so
shared code does not have to guard it.
Returns
setNativeWindowMode
public void setNativeWindowMode(boolean nativeWindowMode)Sets whether this dialog is backed by a real operating system window.
Takes effect the next time the dialog is shown. A dialog already on screen is never moved between the two: there is no safe point to reparent a live, focused, possibly editing hierarchy while a caller is parked waiting for it.
Parameters
nativeWindowModeboolean- true to open this dialog in its own window
getNativeWindow
public Window getNativeWindow()Returns
initNativeWindow
protected void initNativeWindow(Window w)Parameters
wWindow- the window about to be shown
isDefaultInteractionDialogMode
public static boolean isDefaultInteractionDialogMode()Indicates whether newly-created dialogs should use InteractionDialog under the hood.
This default can be configured globally using the theme constant
defaultInteractionDialogModeBool.
setDefaultInteractionDialogMode
public static void setDefaultInteractionDialogMode(boolean defaultInteractionDialogMode)Indicates whether newly-created dialogs should use InteractionDialog under the hood.
This value overrides the theme constant defaultInteractionDialogModeBool
for the remainder of the app lifecycle.
isInteractionDialogMode
public boolean isInteractionDialogMode()InteractionDialog under the hood.setInteractionDialogMode
public void setInteractionDialogMode(boolean interactionDialogMode)InteractionDialog under the hood.setPreviousForm
public void setPreviousForm(Form previousForm)Parameters
previousFormForm- the previous form
initGlobalToolbar
protected final void initGlobalToolbar()Overriden to disable the toolbar in dialogs
Allows subclasses to disable the global toolbar for a specific form by overriding this method
getContentPane
public Container getContentPane()Returns
getLayout
public Layout getLayout()Returns
setLayout
public final void setLayout(Layout layout)Parameters
layoutLayout- the specified layout manager
getTitle
public String getTitle()Returns
setTitle
public final void setTitle(String title)Parameters
titleString- the form title
addComponent
public final void addComponent(Component cmp)Parameters
cmpComponent- the added param
addComponent
public void addComponent(Object constraints, Component cmp)Parameters
constraintsObject- this method is useful when the Layout requires a constraint such as the BorderLayout. In this case you need to specify an additional data when you add a Component, such as “CENTER”, “NORTH”…
cmpComponent- component to add
addComponent
public void addComponent(int index, Object constraints, Component cmp)Parameters
indexint- location to insert the Component
constraintsObject- this method is useful when the Layout requires a constraint such as the BorderLayout. In this case you need to specify an additional data when you add a Component, such as “CENTER”, “NORTH”…
cmpComponent- component to add
addComponent
public void addComponent(int index, Component cmp)Parameters
indexint- location to insert the Component
cmpComponent- the added param
Throws
ArrayIndexOutOfBoundsException- if index is out of bounds
IllegalArgumentException- if Component is already contained or the cmp is a Form Component
removeAll
public void removeAll()removeComponent
public void removeComponent(Component cmp)Parameters
cmpComponent- the component to be removed
refreshTheme
public void refreshTheme(boolean merge)Refreshing the theme reinstalls the menu bar, and installing it moves the form’s title component into the title area. A dialog’s title component is its own title label, and a dialog keeps the form title area hidden – so without putting the label back where it belongs, refreshing the theme loses the dialog’s title altogether, along with the space it occupied in the centered-title layout.
Makes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME!
Parameters
mergeboolean- indicates if the current styles should be merged with the new styles
getTitleComponent
public Label getTitleComponent()Returns
setTitleComponent
public void setTitleComponent(Label title)Parameters
titleLabel- new title component
isTitleCentered
public boolean isTitleCentered()Returns
setTitleCentered
public void setTitleCentered(boolean titleCentered)Parameters
titleCenteredboolean- true to use the centered title layout
getTitleStyle
public Style getTitleStyle()Returns
getDialogComponent
public Container getDialogComponent()Returns
setTitleComponent
public void setTitleComponent(Label title, Transition t)Parameters
titleLabel- new title component
tTransition- transition for title replacement
getDialogUIID
public String getDialogUIID()Returns
setDialogUIID
public void setDialogUIID(String uiid)Parameters
uiidString- the id for the dialog
getDialogStyle
public Style getDialogStyle()Returns
setDialogStyle
public void setDialogStyle(Style style)initLaf
protected void initLaf(UIManager uim)Parameters
uimUIManager- the UIManager instance
show
public Command show(int top, int bottom, int left, int right, boolean includeTitle)This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. This method will block the calling thread even if the calling thread is the EDT. Notice that this method will not release the block until dispose is called even if show() from another form is called!
Modal dialogs Allow the forms “content” to “hang in mid air” this is especially useful for dialogs where you would want the underlying form to “peek” from behind the form.
Parameters
topint- space in pixels between the top of the screen and the form
bottomint- space in pixels between the bottom of the screen and the form
leftint- space in pixels between the left of the screen and the form
rightint- space in pixels between the right of the screen and the form
includeTitleboolean- whether the title should hang in the top of the screen or be glued onto the content pane
Returns
show
public Command show(int top, int bottom, int left, int right)This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. This method will block the calling thread even if the calling thread is the EDT. Notice that this method will not release the block until dispose is called even if show() from another form is called!
Modal dialogs Allow the forms “content” to “hang in mid air” this is especially useful for dialogs where you would want the underlying form to “peek” from behind the form.
See this sample for showing a dialog at the bottom of the screen:
Dialog dlg = new Dialog("At Bottom");
dlg.setLayout(new BorderLayout());
// span label accepts the text and the UIID for the dialog body
dlg.add(new SpanLabel("Dialog Body text", "DialogBody"));
int h = Display.getInstance().getDisplayHeight();
dlg.setDisposeWhenPointerOutOfBounds(true);
dlg.show(h /8 * 7, 0, 0, 0);
Parameters
topint- space in pixels between the top of the screen and the form
bottomint- space in pixels between the bottom of the screen and the form
leftint- space in pixels between the left of the screen and the form
rightint- space in pixels between the right of the screen and the form
Returns
show
public Command show(int top, int bottom, int left, int right, boolean includeTitle, boolean modal)This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. This method will block the calling thread even if the calling thread is the EDT. Notice that this method will not release the block until dispose is called even if show() from another form is called!
Modal dialogs Allow the forms “content” to “hang in mid air” this is especially useful for dialogs where you would want the underlying form to “peek” from behind the form.
Parameters
topint- space in pixels between the top of the screen and the form
bottomint- space in pixels between the bottom of the screen and the form
leftint- space in pixels between the left of the screen and the form
rightint- space in pixels between the right of the screen and the form
includeTitleboolean- whether the title should hang in the top of the screen or be glued onto the content pane
modalboolean- indicates the dialog should be modal set to false for modeless dialog which is useful for some use cases
Returns
showAtPosition
public Command showAtPosition(int top, int bottom, int left, int right, boolean modal)This method shows the form as a modal alert allowing us to produce a behavior of an alert/dialog box. This method will block the calling thread even if the calling thread is the EDT. Notice that this method will not release the block until dispose is called even if show() from another form is called!
Modal dialogs Allow the forms “content” to “hang in mid air” this is especially useful for dialogs where you would want the underlying form to “peek” from behind the form.
Parameters
topint- space in pixels between the top of the screen and the form
bottomint- space in pixels between the bottom of the screen and the form
leftint- space in pixels between the left of the screen and the form
rightint- space in pixels between the right of the screen and the form
modalboolean- indicates the dialog should be modal set to false for modeless dialog which is useful for some use cases
Returns
setTimeout
public void setTimeout(long time)Parameters
timelong- a milliseconds time used to dispose the dialog
setTransitions
public void setTransitions(Transition transition)configureCommands
public void configureCommands(Command[] cmds, boolean commandsAsButtons)autoAdjust
protected void autoAdjust(int w, int h)Parameters
wint- width of the screen
hint- height of the screen
placeButtonCommands
public void placeButtonCommands(Command[] cmds)Parameters
cmdsCommand[]- the commands to place
keyReleased
public void keyReleased(int keyCode)Parameters
keyCodeint- the key code value to indicate a physical key.
onShow
protected void onShow()showBack
public void showBack()setScrollable
public void setScrollable(boolean scrollable)Parameters
scrollableboolean- whether the component should/could scroll on the X and Y axis
show
public void show()showModeless
public void showModeless()setTopLevelHost
public void setTopLevelHost(TopLevelContainer host)The top level this dialog appears on when it is shown.
A dialog is not attached to anything at the moment it is shown, so it cannot
resolve its own host the way an attached component can. Left unset it uses the
focused window, else the current Form – which is the historical behaviour and
the right answer for an application with one window. Set it to put the dialog on
a particular com.codename1.ui.Window instead.
Parameters
hostTopLevelContainer- the top level to show on, or null to work it out
getTopLevelHost
public TopLevelContainer getTopLevelHost()#setTopLevelHost(TopLevelContainer).Returns
addCommand
public void addCommand(Command cmd, int offset)Hands menu style commands to the window so the platform can put them wherever it shows a window’s commands.
Button bar commands are deliberately not published: placeButtonCommands never
calls addCommand, so a dialog with an OK and a Cancel button has a command
count of zero and no native menu is built for them. They are buttons inside the
dialog and they stay that way.
Parameters
cmdCommand- the Form command to be added
offsetint- position in which the command is added
removeCommand
public void removeCommand(Command cmd)Removes the command from the menu bar softkeys
Taken off the operating system window too. A command removed while the dialog was showing stayed on the platform menu and could still be picked from it, which then reached the dialog through the command bridge as though it were still there.
Parameters
cmdCommand- the Form command to be removed
removeAllCommands
public void removeAllCommands()Clear menu commands from the menu bar
Cleared from the operating system window too, for the same reason.
showPopupDialog
public Command showPopupDialog(Component c)Parameters
cComponent- the context component which is used to position the dialog and can also be pointed at
Returns
showPopupDialog
public Command showPopupDialog(Rectangle rect)Parameters
rectRectangle- the screen rectangle to which the popup should point
Returns
showPacked
public Command showPacked(String position, boolean modal)Parameters
positionString- one of the values from the BorderLayout class e.g. BorderLayout.CENTER, BorderLayout.NORTH etc.
modalboolean- whether the dialog should be modal or modaless
Returns
showStretched
public Command showStretched(String position, boolean modal)Parameters
positionString- one of the values from the BorderLayout class except for center e.g. BorderLayout.NORTH, BorderLayout.EAST etc.
modalboolean- whether the dialog should be modal or modaless
Returns
showStetched
public Command showStetched(String position, boolean modal)Parameters
positionString- one of the values from the BorderLayout class except for center e.g. BorderLayout.NORTH, BorderLayout.EAST etc.
modalboolean- whether the dialog should be modal or modaless
Returns
getDialogPreferredSize
public Dimension getDialogPreferredSize()Returns
dispose
public void dispose()showDialog
public Command showDialog()Returns
actionCommand
protected void actionCommand(Command cmd)Parameters
cmdCommand- the action command
animate
public boolean animate()com.codename1.ui.Display class.Returns
isAutoDispose
public boolean isAutoDispose()Returns
setAutoDispose
public final void setAutoDispose(boolean autoDispose)Parameters
autoDisposeboolean- true if this dialog disposes on any command
getDialogType
public int getDialogType()Returns
setDialogType
public void setDialogType(int dialogType)Parameters
dialogTypeint- can be one of TYPE_WARNING, TYPE_INFO, TYPE_ERROR, TYPE_CONFIRMATION or TYPE_ALARM
isDisposeWhenPointerOutOfBounds
public boolean isDisposeWhenPointerOutOfBounds()Returns
setDisposeWhenPointerOutOfBounds
public final void setDisposeWhenPointerOutOfBounds(boolean disposeWhenPointerOutOfBounds)pointerReleased
public void pointerReleased(int x, int y)Parameters
xint- the pointer x coordinate
yint- the pointer y coordinate
pointerPressed
public void pointerPressed(int x, int y)Parameters
xint- the pointer x coordinate
yint- the pointer y coordinate
wasDisposedDueToOutOfBoundsTouch
public boolean wasDisposedDueToOutOfBoundsTouch()Returns
getDialogPosition
public String getDialogPosition()Returns
setDialogPosition
public void setDialogPosition(String dialogPosition)Parameters
dialogPositionString- the dialogPosition to set
growOrShrink
public void growOrShrink()getPopupDirectionBiasPortrait
public Boolean getPopupDirectionBiasPortrait()Returns
setPopupDirectionBiasPortrait
public void setPopupDirectionBiasPortrait(Boolean popupDirectionBiasPortrait)Parameters
popupDirectionBiasPortraitBoolean- the popupDirectionBiasPortrait to set
wasDisposedDueToRotation
public boolean wasDisposedDueToRotation()Returns
getBlurBackgroundRadius
public float getBlurBackgroundRadius()Returns
setBlurBackgroundRadius
public void setBlurBackgroundRadius(float blurBackgroundRadius)dialogBlurRadiusIntParameters
blurBackgroundRadiusfloat- the blurBackgroundRadius to set
setUIIDByPopupPosition
public void setUIIDByPopupPosition(boolean b)Parameters
bboolean- to enable