use of com.vaadin.ui.Button in project Activiti by Activiti.
the class DeploymentDetailPanel method addActions.
protected void addActions() {
// Delete button
Button deleteButton = new Button(i18nManager.getMessage(Messages.DEPLOYMENT_DELETE));
deleteButton.setIcon(Images.DELETE);
deleteButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
viewManager.showPopupWindow(new DeleteDeploymentPopupWindow(deployment, parent));
}
});
parent.getToolBar().removeAllButtons();
parent.getToolBar().addButton(deleteButton);
}
use of com.vaadin.ui.Button in project Activiti by Activiti.
the class DeploymentDetailPanel method addProcessDefinitionLinks.
protected void addProcessDefinitionLinks() {
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).orderByProcessDefinitionName().asc().list();
if (!processDefinitions.isEmpty()) {
// Header
Label processDefinitionHeader = new Label(i18nManager.getMessage(Messages.DEPLOYMENT_HEADER_DEFINITIONS));
processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_H3);
processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
processDefinitionHeader.setWidth(100, UNITS_PERCENTAGE);
addDetailComponent(processDefinitionHeader);
// processes
VerticalLayout processDefinitionLinksLayout = new VerticalLayout();
processDefinitionLinksLayout.setSpacing(true);
processDefinitionLinksLayout.setMargin(true, false, true, false);
addDetailComponent(processDefinitionLinksLayout);
for (final ProcessDefinition processDefinition : processDefinitions) {
Button processDefinitionButton = new Button(getProcessDisplayName(processDefinition));
processDefinitionButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
viewManager.showDeployedProcessDefinitionPage(processDefinition.getId());
}
});
processDefinitionButton.addStyleName(Reindeer.BUTTON_LINK);
processDefinitionLinksLayout.addComponent(processDefinitionButton);
}
}
}
use of com.vaadin.ui.Button in project Activiti by Activiti.
the class EventOverviewPanel method initEvents.
protected void initEvents() {
HorizontalLayout eventsHeader = new HorizontalLayout();
eventsHeader.setSpacing(true);
eventsHeader.setWidth(80, UNITS_PERCENTAGE);
eventsHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
addDetailComponent(eventsHeader);
initEventTitle(eventsHeader);
stepButton = new Button(i18nManager.getMessage(Messages.CRYSTALBALL_BUTTON_NEXTEVENT));
stepButton.setEnabled(false);
stepButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
if (!SimulationRunContext.getEventCalendar().getEvents().isEmpty()) {
simulationDebugger.step();
refreshEvents();
}
}
});
eventsHeader.addComponent(stepButton);
eventsHeader.setComponentAlignment(stepButton, Alignment.MIDDLE_LEFT);
showProcessInstanceButton = new Button();
showProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK);
showProcessInstanceButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (replayHistoricInstance != null) {
ExplorerApp.get().getViewManager().showMyProcessInstancesPage(replayHistoricInstance.getId());
}
}
});
eventsHeader.addComponent(showProcessInstanceButton);
eventsHeader.setComponentAlignment(showProcessInstanceButton, Alignment.MIDDLE_LEFT);
eventLayout = new HorizontalLayout();
eventLayout.setWidth(100, UNITS_PERCENTAGE);
addDetailComponent(eventLayout);
initEventsTable();
}
use of com.vaadin.ui.Button in project Activiti by Activiti.
the class MainMenuBar method initButtons.
protected void initButtons() {
// TODO: fixed widths based on i18n strings?
Button taskButton = addMenuButton(ViewManager.MAIN_NAVIGATION_TASK, i18nManager.getMessage(Messages.MAIN_MENU_TASKS), Images.MAIN_MENU_TASKS, false, 80);
taskButton.addListener(new ShowTasksClickListener());
menuItemButtons.put(ViewManager.MAIN_NAVIGATION_TASK, taskButton);
Button processButton = addMenuButton(ViewManager.MAIN_NAVIGATION_PROCESS, i18nManager.getMessage(Messages.MAIN_MENU_PROCESS), Images.MAIN_MENU_PROCESS, false, 80);
processButton.addListener(new ShowProcessDefinitionsClickListener());
menuItemButtons.put(ViewManager.MAIN_NAVIGATION_PROCESS, processButton);
Button reportingButton = addMenuButton(ViewManager.MAIN_NAVIGATION_REPORT, i18nManager.getMessage(Messages.MAIN_MENU_REPORTS), Images.MAIN_MENU_REPORTS, false, 80);
reportingButton.addListener(new ShowReportsClickListener());
menuItemButtons.put(ViewManager.MAIN_NAVIGATION_REPORT, reportingButton);
if (ExplorerApp.get().getLoggedInUser().isAdmin()) {
Button manageButton = addMenuButton(ViewManager.MAIN_NAVIGATION_MANAGE, i18nManager.getMessage(Messages.MAIN_MENU_MANAGEMENT), Images.MAIN_MENU_MANAGE, false, 90);
manageButton.addListener(new ShowManagementClickListener());
menuItemButtons.put(ViewManager.MAIN_NAVIGATION_MANAGE, manageButton);
}
}
use of com.vaadin.ui.Button in project Activiti by Activiti.
the class MainMenuBar method setMainNavigation.
/**
* Highlights the given main navigation in the menubar.
*/
public synchronized void setMainNavigation(String navigation) {
if (currentMainNavigation != null) {
menuItemButtons.get(currentMainNavigation).removeStyleName(ExplorerLayout.STYLE_ACTIVE);
}
currentMainNavigation = navigation;
Button current = menuItemButtons.get(navigation);
if (current != null) {
current.addStyleName(ExplorerLayout.STYLE_ACTIVE);
}
}
Aggregations