/** * Removes selected items from the list component with confirmation dialog. <br> * After confirmation removes items from DB if the bound container is not nested. * * @param target list component * @param <E> entity type */ public <E extends Entity> void removeSelected(ListComponent<E> target) { builder(target) .withConfirmation(true) .remove(); }
/** * Excludes selected items from the list component without confirmation. Works with nested containers only. * * @param target list component * @param <E> entity type */ public <E extends Entity> void excludeSelected(ListComponent<E> target) { builder(target) .withConfirmation(false) .exclude(); }
@Override protected DataGrid createComponentInternal() { return factory.create(DataGrid.NAME); } }
protected void showNotification(String msg) { ui.getNotifications().create(NotificationType.TRAY) .withCaption(msg) .show(); }
/** * Sets the unit used for the width. * * @param widthUnit the unit used for the width */ public DialogOptions setWidthUnit(SizeUnit widthUnit) { return setWidth(this.width, widthUnit); }
@Override public Collection<Component> getComponents() { return ComponentsHelper.getComponents(this); } }
/** * Set height of a window to AUTO if it will be opened as a dialog or change height at run time if the window is already opened as a dialog. */ public DialogOptions setHeightAuto() { return setHeight(AUTO_SIZE); }
/** * Creates a screen by its controller class. * <p> * By default, the screen will be opened in the current tab of the main window ({@link OpenMode#THIS_TAB}). * * @param screenClass screen controller class */ default <T extends Screen> T create(Class<T> screenClass) { return create(screenClass, OpenMode.THIS_TAB, FrameOwner.NO_OPTIONS); }
/** * Creates a screen fragment by its id. * * @param parent parent UI controller * @param screenFragmentId id of screen fragment */ default ScreenFragment create(FrameOwner parent, String screenFragmentId) { return create(parent, screenFragmentId, FrameOwner.NO_OPTIONS); }
public OpenType resizable(Boolean resizable) { OpenType instance = getMutableInstance(); instance.resizable = resizable; return instance; }
private OpenType getMutableInstance() { if (!mutable) { return copy(); } return this; }
@Override public void showNotification(String caption) { ui.getNotifications().create() .withCaption(caption) .show(); }
/** * Set width of a window if it will be opened as a dialog or change width * at run time if the window is already opened as a dialog. If the {@link #widthUnit} * is set then its value will be used, {@link com.haulmont.cuba.gui.components.SizeUnit#PIXELS} otherwise. * * @param width the width value in the unit used for the height */ public DialogOptions setWidth(Float width) { return setWidth(width, this.widthUnit); }
public OpenType setCloseable(Boolean closeable) { OpenType instance = getMutableInstance(); instance.closeable = closeable; return instance; }
/** * Set width of a window to AUTO if it will be opened as a dialog or change width at run time if the window is already opened as a dialog. */ public DialogOptions setWidthAuto() { return setWidth(AUTO_SIZE); }
public OpenType setHeight(Float height) { OpenType instance = getMutableInstance(); instance.height = height; return instance; }
public OpenType positionY(Integer positionY) { OpenType instance = getMutableInstance(); instance.positionY = positionY; return instance; }
public OpenType center() { OpenType instance = getMutableInstance(); instance.positionX = null; instance.positionY = null; return instance; }
public OpenType setResizable(Boolean resizable) { OpenType instance = getMutableInstance(); instance.resizable = resizable; return instance; }
/** * Set maximized to true if a window should be maximized across the screen. */ public OpenType maximized(Boolean maximized) { OpenType instance = getMutableInstance(); instance.maximized = maximized; return instance; }