public void hideHelp() { synchronized (this) { if (!helpActive) return; helpView.removeAllComponents(); contentScreen.removeComponent(helpView); helpActive = false; } }
protected void removeCancelButtonAndAddMenuBar() { typeHeaderLayout.removeComponent(cancelTagButton); typeHeaderLayout.addComponent(menu, 1); }
protected void removeCancelButtonAndAddMenuBar() { typeHeaderLayout.removeComponent(cancelTagButton); typeHeaderLayout.addComponent(menu, 1); }
@Override public void buttonClick(ClickEvent clickEvent) { hl.removeComponent(nameTf); hl.removeComponent(tvf); hl.removeComponent(minusTargetValueButton); hl.setImmediate(true); hl.markAsDirty(); targetValueTableCellLayout.removeComponent(hl); targetValueTableCellLayout.markAsDirty(); deletedManyToManyTargetConfigurationValues.add(targetValue); } });
/** * Removes the given button from the toolbar.<p> * * @param button the button to remove */ public void removeButton(Component button) { m_itemsLeft.removeComponent(button); m_itemsRight.removeComponent(button); m_leftButtons.removeComponent(button); m_rightButtons.removeComponent(button); updateFoldingThreshhold(); }
@Override public void buttonClick(ClickEvent clickEvent) { hl.removeComponent(tvf); hl.removeComponent(minusTargetValueButton); hl.setImmediate(true); hl.markAsDirty(); targetValueTableCellLayout.removeComponent(hl); targetValueTableCellLayout.markAsDirty(); deletedManyToManyTargetConfigurationValues.add(targetValue); } });
/** * Enables or removes the default toolbar buttons.<p> * These are the context menu and the quick launch drop down.<p> * The default is <code>enabled = true</code>.<p> * * @param enabled <code>true</code> to enable the buttons */ public void enableDefaultButtons(boolean enabled) { if (enabled) { m_itemsRight.addComponent(m_contextMenu, 0); m_itemsRight.addComponent(m_quickLaunchDropDown, 1); } else { m_itemsRight.removeComponent(m_contextMenu); m_itemsRight.removeComponent(m_quickLaunchDropDown); } updateFoldingThreshhold(); }
protected void removeMenuBarAndAddCancelButton() { typeHeaderLayout.removeComponent(menu); typeHeaderLayout.addComponent(createCancelButtonForUpdateOrDeleteTag(), 1); }
protected void removeMenuBarAndAddCancelButton() { typeHeaderLayout.removeComponent(menu); typeHeaderLayout.addComponent(createCancelButtonForUpdateOrDeleteTag(), 1); }
@Override public void buttonClick(ClickEvent clickEvent) { hl.removeComponent(sourceSystemValueTextField2); hl.removeComponent(minusTargetValueButton); hl.setImmediate(true); hl.markAsDirty(); tableCellLayout.removeComponent(hl); tableCellLayout.markAsDirty(); mappingConfiguration.getSourceConfigurationValues().remove(partnerSourceConfigurationValue); } });
private void createListeners() { nameTextFieldBlurListener = event -> { if (!StringUtils.isEmpty(nameTextField.getValue())) { captionLayout.removeComponent(nameTextField); captionLayout.addComponent(nameLabel); } }; nameLayoutClickListner = event -> { if (event.getClickedComponent() instanceof Label) { captionLayout.removeComponent(nameLabel); captionLayout.addComponent(nameTextField); nameTextField.focus(); } }; queryTextField.addTextChangeListener((valid, query) -> enableDisableSaveButton(!valid, query)); }
private void createListeners() { nameTextFieldBlurListener = event -> { if (!StringUtils.isEmpty(nameTextField.getValue())) { captionLayout.removeComponent(nameTextField); captionLayout.addComponent(nameLabel); } }; nameLayoutClickListner = event -> { if (event.getClickedComponent() instanceof Label) { captionLayout.removeComponent(nameLabel); captionLayout.addComponent(nameTextField); nameTextField.focus(); } }; queryTextField.addTextChangeListener((valid, query) -> enableDisableSaveButton(!valid, query)); }
private void updateComponents() { if (!isEditable() && !isEmpty()) { textField.setReadOnly(true); if (linkLayout.getComponentIndex(selectButton) != -1) { linkLayout.removeComponent(selectButton); } } else { setButtonCaptionAndDescription(); } }
public class TestcaseApplication extends Application implements ClickListener { private static final long serialVersionUID = 75232258896642392L; private final HorizontalLayout mainLayout = new HorizontalLayout(); private final YourPanel panel = new YourPanel(this); @Override public void init() { setTheme("example"); Window mainWindow = new Window("Playground Application"); setMainWindow(mainWindow); mainWindow.setContent(mainLayout); mainLayout.addComponent(panel); } public void buttonClick(ClickEvent event) { mainLayout.removeComponent(panel); } public class YourPanel extends Panel { public YourPanel(ClickListener listener) { super(); addComponent(new Button("Remove", listener)); } } }
/** * Sets an icon to the message dialog. * * @param icon An embedded resource * @param width The width i.e. "48px" * @param height The height i.e. "48px" * @return The {@link MessageBox} instance itself */ public MessageBox withIcon(Component icon, String width, String height) { if (this.icon != null) { contentLayout.removeComponent(this.icon); } this.icon = icon; if (icon != null) { contentLayout.addComponent(icon, 0); contentLayout.setComponentAlignment(icon, Alignment.MIDDLE_CENTER); icon.setWidth(width); icon.setHeight(height); } return this; }
/** * Sets a component as content to the message dialog. * * @param messageComponent The component as content * @return The {@link MessageBox} instance itself */ public MessageBox withMessage(Component messageComponent) { if (this.messageComponent != null) { contentLayout.removeComponent(this.messageComponent); } this.messageComponent = messageComponent; if (messageComponent != null) { messageComponent.setSizeFull(); contentLayout.addComponent(messageComponent, contentLayout.getComponentCount()); contentLayout.setExpandRatio(messageComponent, 1.0f); contentLayout.setComponentAlignment(messageComponent, Alignment.MIDDLE_CENTER); } return this; }
@Override public void setButtonsPanel(ButtonsPanel panel) { if (buttonsPanel != null && topPanel != null) { topPanel.removeComponent(buttonsPanel.unwrap(com.vaadin.ui.Component.class)); buttonsPanel.setParent(null); } buttonsPanel = panel; if (panel != null) { if (panel.getParent() != null && panel.getParent() != this) { throw new IllegalStateException("Component already has parent"); } if (topPanel == null) { topPanel = createTopPanel(); topPanel.setWidth(100, Sizeable.Unit.PERCENTAGE); componentComposition.addComponentAsFirst(topPanel); } topPanel.addComponent(panel.unwrap(com.vaadin.ui.Component.class)); if (panel instanceof VisibilityChangeNotifier) { ((VisibilityChangeNotifier) panel).addVisibilityChangeListener(event -> updateCompositionStylesTopPanelVisible() ); } panel.setParent(this); } updateCompositionStylesTopPanelVisible(); }
/** * Places the buttons formerly moved to the sub menu back into the toolbar.<p> */ private void unfoldButtons() { m_itemsRight.removeComponent(m_foldedButtonsMenu); while (m_leftButtons.getComponentCount() > 0) { Component comp = m_leftButtons.getComponent(0); if (!isAlwaysShow(comp)) { m_leftButtons.removeComponent(comp); m_itemsLeft.addComponent(comp); } } int index = 0; while (m_rightButtons.getComponentCount() > 0) { Component comp = m_rightButtons.getComponent(0); m_rightButtons.removeComponent(comp); m_itemsRight.addComponent(comp, index); index++; } m_buttonsFolded = false; markAsDirtyRecursive(); } }
@Override public void setRowsCount(RowsCount rowsCount) { if (this.rowsCount != null && topPanel != null) { topPanel.removeComponent(this.rowsCount.unwrap(com.vaadin.ui.Component.class)); } this.rowsCount = rowsCount; if (rowsCount != null) { if (topPanel == null) { topPanel = createTopPanel(); topPanel.setWidth("100%"); componentComposition.addComponentAsFirst(topPanel); } com.vaadin.ui.Component rc = rowsCount.unwrap(com.vaadin.ui.Component.class); topPanel.addComponent(rc); topPanel.setExpandRatio(rc, 1); topPanel.setComponentAlignment(rc, com.vaadin.ui.Alignment.BOTTOM_RIGHT); if (rowsCount instanceof VisibilityChangeNotifier) { ((VisibilityChangeNotifier) rowsCount).addVisibilityChangeListener(event -> updateCompositionStylesTopPanelVisible() ); } } updateCompositionStylesTopPanelVisible(); }
protected void generateReport(ProcessInstance processInstance) { // Report dataset is stored as historical variable as json HistoricVariableInstance historicVariableInstance = ProcessEngines.getDefaultProcessEngine() .getHistoryService() .createHistoricVariableInstanceQuery() .processInstanceId(processInstance.getId()) .variableName("reportData") .singleResult(); // Generate chart byte[] reportData = (byte[]) historicVariableInstance.getValue(); ChartComponent chart = ChartGenerator.generateChart(reportData); chart.setWidth(100, UNITS_PERCENTAGE); chart.setHeight(100, UNITS_PERCENTAGE); // Put chart on screen if (processDefinitionStartForm != null) { detailContainer.removeComponent(processDefinitionStartForm); processDefinitionStartForm = null; } detailContainer.addComponent(chart); // The historic process instance can now be removed from the system // Only when save is clicked, the report will be regenerated ProcessEngines.getDefaultProcessEngine().getHistoryService().deleteHistoricProcessInstance(processInstance.getId()); }