Search in sources :

Example 21 with HorizontalLayout

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);
}
Also used : Item(com.vaadin.data.Item) DeletePropertyClickListener(org.activiti.explorer.ui.process.simple.editor.listener.DeletePropertyClickListener) Button(com.vaadin.ui.Button) ComboBox(com.vaadin.ui.ComboBox) CheckBox(com.vaadin.ui.CheckBox) AddPropertyClickListener(org.activiti.explorer.ui.process.simple.editor.listener.AddPropertyClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 22 with HorizontalLayout

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);
}
Also used : GridLayout(com.vaadin.ui.GridLayout) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) Label(com.vaadin.ui.Label) Embedded(com.vaadin.ui.Embedded) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 23 with HorizontalLayout

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);
}
Also used : Label(com.vaadin.ui.Label) TextField(com.vaadin.ui.TextField) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 24 with HorizontalLayout

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();
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 25 with HorizontalLayout

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);
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

HorizontalLayout (com.vaadin.ui.HorizontalLayout)85 Label (com.vaadin.ui.Label)45 Button (com.vaadin.ui.Button)26 VerticalLayout (com.vaadin.ui.VerticalLayout)20 Embedded (com.vaadin.ui.Embedded)19 ClickEvent (com.vaadin.ui.Button.ClickEvent)17 ClickListener (com.vaadin.ui.Button.ClickListener)15 ExternalResource (com.vaadin.terminal.ExternalResource)7 GridLayout (com.vaadin.ui.GridLayout)7 TextField (com.vaadin.ui.TextField)6 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)6 StreamResource (com.vaadin.terminal.StreamResource)5 Link (com.vaadin.ui.Link)5 Panel (com.vaadin.ui.Panel)5 InputStream (java.io.InputStream)4 URL (java.net.URL)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)3 ExternalResource (com.vaadin.server.ExternalResource)3