use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class PropertyTable method addPropertyRow.
protected void addPropertyRow(Object itemId, String propertyName, String propertyType, Boolean required) {
Object newItemId = null;
if (itemId == null) {
// add at the end of list
newItemId = addItem();
} else {
newItemId = addItemAfter(itemId);
}
Item newItem = getItem(newItemId);
// name
newItem.getItemProperty(ID_PROPERTY_NAME).setValue(propertyName == null ? DEFAULT_PROPERTY_NAME : propertyName);
// type
ComboBox typeComboBox = new ComboBox("", Arrays.asList("text", "number", "date"));
typeComboBox.setNullSelectionAllowed(false);
if (propertyType == null) {
typeComboBox.setValue(typeComboBox.getItemIds().iterator().next());
} else {
typeComboBox.setValue(propertyType);
}
newItem.getItemProperty(ID_PROPERTY_TYPE).setValue(typeComboBox);
// required
CheckBox requiredCheckBox = new CheckBox();
requiredCheckBox.setValue(required == null ? false : required);
newItem.getItemProperty(ID_PROPERTY_REQUIRED).setValue(requiredCheckBox);
// actions
HorizontalLayout actionButtons = new HorizontalLayout();
Button deleteRowButton = new Button("-");
deleteRowButton.setData(newItemId);
deleteRowButton.addListener(new DeletePropertyClickListener(this));
actionButtons.addComponent(deleteRowButton);
Button addRowButton = new Button("+");
addRowButton.setData(newItemId);
addRowButton.addListener(new AddPropertyClickListener(this));
actionButtons.addComponent(addRowButton);
newItem.getItemProperty(ID_PROPERTY_ACTIONS).setValue(actionButtons);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class AbstractProcessDefinitionDetailPanel method initHeader.
protected void initHeader() {
GridLayout details = new GridLayout(2, 2);
details.setWidth(100, UNITS_PERCENTAGE);
details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
details.setSpacing(true);
details.setMargin(false, false, true, false);
details.setColumnExpandRatio(1, 1.0f);
detailPanelLayout.addComponent(details);
// Image
Embedded image = new Embedded(null, Images.PROCESS_50);
details.addComponent(image, 0, 0, 0, 1);
// Name
Label nameLabel = new Label(getProcessDisplayName(processDefinition));
nameLabel.addStyleName(Reindeer.LABEL_H2);
details.addComponent(nameLabel, 1, 0);
// Properties
HorizontalLayout propertiesLayout = new HorizontalLayout();
propertiesLayout.setSpacing(true);
details.addComponent(propertiesLayout);
// Version
String versionString = i18nManager.getMessage(Messages.PROCESS_VERSION, processDefinition.getVersion());
Label versionLabel = new Label(versionString);
versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_VERSION);
propertiesLayout.addComponent(versionLabel);
// Add deploy time
PrettyTimeLabel deployTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.PROCESS_DEPLOY_TIME), deployment.getDeploymentTime(), null, true);
deployTimeLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_DEPLOY_TIME);
propertiesLayout.addComponent(deployTimeLabel);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class SaveReportPopupWindow method createNameTextField.
protected void createNameTextField(I18nManager i18nManager, VerticalLayout layout) {
HorizontalLayout fieldLayout = new HorizontalLayout();
fieldLayout.setWidth(100, UNITS_PERCENTAGE);
layout.addComponent(fieldLayout);
fieldLayout.addComponent(new Label(i18nManager.getMessage(Messages.REPORTING_SAVE_POPUP_NAME)));
nameField = new TextField();
nameField.setWidth(250, UNITS_PIXELS);
nameField.focus();
fieldLayout.addComponent(nameField);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class SavedReportDetailPanel method initUi.
protected void initUi() {
setSizeFull();
addStyleName(Reindeer.LAYOUT_WHITE);
detailPanelLayout = new VerticalLayout();
detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
detailPanelLayout.setMargin(true);
setDetailContainer(detailPanelLayout);
initHeader();
detailContainer = new HorizontalLayout();
detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
detailPanelLayout.addComponent(detailContainer);
detailContainer.setSizeFull();
initForm();
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class JobDetailPanel method addLinkToProcessDefinition.
protected void addLinkToProcessDefinition(final VerticalLayout verticalLayout, final String labelText, final boolean isSuspendedProcessDefinition) {
HorizontalLayout layout = new HorizontalLayout();
verticalLayout.addComponent(layout);
Label processDefinitionLabel = new Label(labelText);
processDefinitionLabel.setSizeUndefined();
layout.addComponent(processDefinitionLabel);
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
Button showProcessDefinitionLink = new Button(job.getProcessDefinitionId());
showProcessDefinitionLink.addStyleName(Reindeer.BUTTON_LINK);
showProcessDefinitionLink.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (isSuspendedProcessDefinition) {
ExplorerApp.get().getViewManager().showSuspendedProcessDefinitionsPage(job.getProcessDefinitionId());
} else {
ExplorerApp.get().getViewManager().showActiveProcessDefinitionsPage(job.getProcessDefinitionId());
}
}
});
layout.addComponent(showProcessDefinitionLink);
}
Aggregations