use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class TaskRelatedContentComponent method initActions.
protected void initActions() {
HorizontalLayout actionsContainer = new HorizontalLayout();
actionsContainer.setSizeFull();
// Title
Label processTitle = new Label(i18nManager.getMessage(Messages.TASK_RELATED_CONTENT));
processTitle.addStyleName(ExplorerLayout.STYLE_H3);
processTitle.setSizeFull();
actionsContainer.addComponent(processTitle);
actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT);
actionsContainer.setExpandRatio(processTitle, 1.0f);
// Add content button
Button addRelatedContentButton = new Button();
addRelatedContentButton.addStyleName(ExplorerLayout.STYLE_ADD);
addRelatedContentButton.addListener(new com.vaadin.ui.Button.ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
CreateAttachmentPopupWindow popup = new CreateAttachmentPopupWindow();
if (task.getProcessInstanceId() != null) {
popup.setProcessInstanceId(task.getProcessInstanceId());
} else {
popup.setTaskId(task.getId());
}
// Add listener to update attachments when added
popup.addListener(new SubmitEventListener() {
private static final long serialVersionUID = 1L;
@Override
protected void submitted(SubmitEvent event) {
taskDetailPanel.notifyRelatedContentChanged();
}
@Override
protected void cancelled(SubmitEvent event) {
// No attachment was added so updating UI isn't needed.
}
});
ExplorerApp.get().getViewManager().showPopupWindow(popup);
}
});
actionsContainer.addComponent(addRelatedContentButton);
actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT);
addComponent(actionsContainer);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class UserDetailsComponent method addUserDetails.
protected void addUserDetails() {
VerticalLayout detailsLayout = new VerticalLayout();
addComponent(detailsLayout);
// Layout for name + skype
HorizontalLayout nameLayout = new HorizontalLayout();
nameLayout.setSpacing(true);
detailsLayout.addComponent(nameLayout);
// Name
Label nameLabel = null;
if (user != null) {
nameLabel = new Label(user.getFirstName() + " " + user.getLastName());
nameLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD);
} else {
nameLabel = new Label(" ", Label.CONTENT_XHTML);
}
nameLayout.addComponent(nameLabel);
// Layout for lower details
HorizontalLayout actionsLayout = new HorizontalLayout();
actionsLayout.setSpacing(true);
detailsLayout.addComponent(actionsLayout);
// Role
Label roleLabel = new Label(role);
actionsLayout.addComponent(roleLabel);
// Action button
if (clickListener != null) {
Button button = new Button(buttonCaption);
button.addStyleName(Reindeer.BUTTON_SMALL);
button.addListener(clickListener);
actionsLayout.addComponent(button);
}
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class ConvertProcessDefinitionPopupWindow method addButtons.
protected void addButtons() {
// Cancel
Button cancelButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
cancelButton.addStyleName(Reindeer.BUTTON_SMALL);
cancelButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
close();
}
});
// Convert
Button convertButton = new Button(i18nManager.getMessage(Messages.PROCESS_CONVERT_POPUP_CONVERT_BUTTON));
convertButton.addStyleName(Reindeer.BUTTON_SMALL);
convertButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
try {
InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), processDefinition.getResourceName());
XMLInputFactory xif = XmlUtil.createSafeXmlInputFactory();
InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
XMLStreamReader xtr = xif.createXMLStreamReader(in);
BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
if (bpmnModel.getMainProcess() == null || bpmnModel.getMainProcess().getId() == null) {
notificationManager.showErrorNotification(Messages.MODEL_IMPORT_FAILED, i18nManager.getMessage(Messages.MODEL_IMPORT_INVALID_BPMN_EXPLANATION));
} else {
if (bpmnModel.getLocationMap().isEmpty()) {
notificationManager.showErrorNotification(Messages.MODEL_IMPORT_INVALID_BPMNDI, i18nManager.getMessage(Messages.MODEL_IMPORT_INVALID_BPMNDI_EXPLANATION));
} else {
BpmnJsonConverter converter = new BpmnJsonConverter();
ObjectNode modelNode = converter.convertToJson(bpmnModel);
Model modelData = repositoryService.newModel();
ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
modelObjectNode.put(MODEL_NAME, processDefinition.getName());
modelObjectNode.put(MODEL_REVISION, 1);
modelObjectNode.put(MODEL_DESCRIPTION, processDefinition.getDescription());
modelData.setMetaInfo(modelObjectNode.toString());
modelData.setName(processDefinition.getName());
repositoryService.saveModel(modelData);
repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
close();
ExplorerApp.get().getViewManager().showEditorProcessDefinitionPage(modelData.getId());
URL explorerURL = ExplorerApp.get().getURL();
URL url = new URL(explorerURL.getProtocol(), explorerURL.getHost(), explorerURL.getPort(), explorerURL.getPath().replace("/ui", "") + "modeler.html?modelId=" + modelData.getId());
ExplorerApp.get().getMainWindow().open(new ExternalResource(url));
}
}
} catch (Exception e) {
notificationManager.showErrorNotification("error", e);
}
}
});
// Alignment
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setSpacing(true);
buttonLayout.addComponent(cancelButton);
buttonLayout.addComponent(convertButton);
addComponent(buttonLayout);
windowLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class DeployModelPopupWindow method initButtons.
protected void initButtons(I18nManager i18nManager) {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setSpacing(true);
buttonLayout.setWidth(100, UNITS_PERCENTAGE);
addComponent(buttonLayout);
deployButton = new Button(i18nManager.getMessage(Messages.MODEL_DEPLOY_BUTTON_DEPLOY));
buttonLayout.addComponent(deployButton);
buttonLayout.setComponentAlignment(deployButton, Alignment.BOTTOM_CENTER);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class EditorProcessDefinitionDetailPanel method initUi.
protected void initUi() {
setSizeFull();
addStyleName(Reindeer.LAYOUT_WHITE);
detailPanelLayout = new VerticalLayout();
detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
detailPanelLayout.setMargin(true);
detailPanelLayout.setSpacing(true);
setDetailContainer(detailPanelLayout);
// All details about the process definition
initHeader();
detailContainer = new HorizontalLayout();
detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
detailPanelLayout.addComponent(detailContainer);
detailContainer.setSizeFull();
initActions();
initProcessDefinitionInfo();
}
Aggregations