/** * Adds the component to the grid in cells column1,row1 (NortWest corner of * the area.) End coordinates (SouthEast corner of the area) are the same as * column1,row1. The coordinates are zero-based. Component width and height * is 1. * * @param component * the component to be added, not <code>null</code>. * @param column * the column index, starting from 0. * @param row * the row index, starting from 0. * @throws OverlapsException * if the new component overlaps with any of the components * already in the grid. * @throws OutOfBoundsException * if the cell is outside the grid area. */ public void addComponent(Component component, int column, int row) throws OverlapsException, OutOfBoundsException { this.addComponent(component, column, row, column, row); }
@Override public void replaceComponent(Component oldComponent, Component newComponent) { // Gets the locations ChildComponentData oldLocation = getState().childData.get(oldComponent); ChildComponentData newLocation = getState().childData.get(newComponent); if (oldLocation == null) { addComponent(newComponent); } else if (newLocation == null) { removeComponent(oldComponent); addComponent(newComponent, oldLocation.column1, oldLocation.row1, oldLocation.column2, oldLocation.row2); } else { int oldAlignment = oldLocation.alignment; oldLocation.alignment = newLocation.alignment; newLocation.alignment = oldAlignment; getState().childData.put(newComponent, oldLocation); getState().childData.put(oldComponent, newLocation); } }
addComponent(child, j, i, j + colspan, i + rowspan); setComponentAlignment(child, alignments.get(child));
addComponent(component, cursorX, cursorY);
public void setRight(Component component) { if (full) return; if (wizard) layout.addComponent(component, 1, row); else layout.addComponent(component, 1, row, 2, row); }
public void setComponent(Component component) { if (!full) { setRight(component); return; } if (wizard) layout.addComponent(component, 0, row, col+size-1, row); else layout.addComponent(component, 0, row, col+size, row); }
private void minimizeDistTable() { mainLayout.addComponent(softwareModuleTableLayout, 2, 0); mainLayout.addComponent(filterBySMTypeLayout, 3, 0); mainLayout.setColumnExpandRatio(1, 0.5F); mainLayout.setColumnExpandRatio(2, 0.5F); }
private void minimizeDistTable() { mainLayout.addComponent(softwareModuleTableLayout, 2, 0); mainLayout.addComponent(filterBySMTypeLayout, 3, 0); mainLayout.setColumnExpandRatio(1, 0.5F); mainLayout.setColumnExpandRatio(2, 0.5F); }
@Override protected Layout wrapFields() { GridLayout hl = new GridLayout(2,1); hl.addComponent(dateField); hl.addComponent(timeField); hl.setComponentAlignment(dateField, Alignment.MIDDLE_LEFT); hl.setComponentAlignment(timeField, Alignment.MIDDLE_LEFT); return hl; } }
protected void addProfileEntry(GridLayout layout, Component name, Component value) { name.addStyleName(ExplorerLayout.STYLE_PROFILE_FIELD); name.setSizeUndefined(); layout.addComponent(name); value.setSizeUndefined(); layout.addComponent(value); }
private void displayTargetWidgetsOnly() { mainLayout.setColumns(3); mainLayout.setRows(1); mainLayout.addComponent(targetTagFilterLayout, 0, 0); mainLayout.addComponent(targetTableLayout, 1, 0); mainLayout.addComponent(actionHistoryLayout, 2, 0); showTargetCount(); mainLayout.setColumnExpandRatio(1, 0.4F); mainLayout.setColumnExpandRatio(2, 0.6F); }
protected void setDetailComponent(Component detail) { if(grid.getComponent(1, 1) != null) { grid.removeComponent(1, 1); } if(detail != null) { grid.addComponent(detail, 1, 1, 1, 2); } }
public void setToggleButton(Component toggleButton) { this.layout.removeComponent(this.toggleButton); this.toggleButton = toggleButton; this.layout.addComponent(this.toggleButton, 0, 0); this.layout.setComponentAlignment(this.toggleButton, Alignment.MIDDLE_LEFT); }
protected void addProfileInputField(GridLayout layout, String name, AbstractField inputField, String inputFieldValue) { Label label = new Label(name + ": "); label.addStyleName(ExplorerLayout.STYLE_PROFILE_FIELD); label.setSizeUndefined(); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); if (inputFieldValue != null) { inputField.setValue(inputFieldValue); } layout.addComponent(inputField); layout.setComponentAlignment(inputField, Alignment.MIDDLE_LEFT); }
public void clear() { grid.removeAllComponents(); grid.setRows(1); grid.addComponent(new Label("<strong>" + MNls.find(this,"attribute=Attribute") +"</strong>",ContentMode.HTML)); grid.addComponent(new Label("<strong>" + MNls.find(this,"value=Value") + "</strong>",ContentMode.HTML)); }
protected void initNameField(GridLayout layout) { nameField = new TextField(); nameField.setWriteThrough(true); nameField.setImmediate(true); layout.addComponent(new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_EDITOR_NAME))); layout.addComponent(nameField); if (workflowName != null) { nameField.setValue(workflowName); workflowName = null; } }
protected void addSimpleRow(String labelMessageKey, String content) { addLabel(labelMessageKey); Label subjectLabel = new Label(content); subjectLabel.setSizeUndefined(); subjectLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD); gridLayout.addComponent(subjectLabel); gridLayout.setComponentAlignment(subjectLabel, Alignment.MIDDLE_LEFT); }
public void buttonClick(Button.ClickEvent event) { start(); layout.removeComponent(startButton); layout.addComponent(stopButton, 1, 3); layout.setComponentAlignment(stopButton, Alignment.MIDDLE_LEFT); statusIconLabel.setCaption(runningIcon.getHtml()); refresh(); } });
public void buttonClick(ClickEvent event) { notifierService.start(); layout.removeComponent(startButton); layout.addComponent(stopButton, 1, 3); layout.setComponentAlignment(stopButton, Alignment.MIDDLE_LEFT); statusIconLabel.setCaption(runningIcon.getHtml()); notificationIntervalLabel.setCaption(Integer.toString(notifierService.getNotificationInterval())); } });
public void buttonClick(ClickEvent event) { notifierService.stop(); layout.removeComponent(stopButton); layout.addComponent(startButton, 1, 3); layout.setComponentAlignment(startButton, Alignment.MIDDLE_LEFT); statusIconLabel.setCaption(stoppedIcon.getHtml()); } });