Search in sources :

Example 1 with ImportModelClickListener

use of org.activiti.explorer.ui.process.listener.ImportModelClickListener in project Activiti by Activiti.

the class EditorProcessDefinitionPage method createMenuBar.

@Override
protected ToolBar createMenuBar() {
    ProcessMenuBar menuBar = new ProcessMenuBar();
    Button newModelButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_NEW));
    newModelButton.addListener(new NewModelClickListener());
    menuBar.addButton(newModelButton);
    Button importModelButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_IMPORT));
    importModelButton.addListener(new ImportModelClickListener());
    menuBar.addButton(importModelButton);
    return menuBar;
}
Also used : Button(com.vaadin.ui.Button) ImportModelClickListener(org.activiti.explorer.ui.process.listener.ImportModelClickListener) NewModelClickListener(org.activiti.explorer.ui.process.listener.NewModelClickListener) ProcessMenuBar(org.activiti.explorer.ui.process.ProcessMenuBar)

Example 2 with ImportModelClickListener

use of org.activiti.explorer.ui.process.listener.ImportModelClickListener in project Activiti by Activiti.

the class EditorProcessDefinitionDetailPanel method initActions.

protected void initActions() {
    newModelButton = new Button(i18nManager.getMessage(Messages.PROCESS_NEW));
    newModelButton.addListener(new NewModelClickListener());
    importModelButton = new Button(i18nManager.getMessage(Messages.PROCESS_IMPORT));
    importModelButton.addListener(new ImportModelClickListener());
    editModelButton = new Button(i18nManager.getMessage(Messages.PROCESS_EDIT));
    editModelButton.addListener(new EditModelClickListener(modelData));
    actionLabel = new Label(i18nManager.getMessage(Messages.MODEL_ACTION));
    actionLabel.setSizeUndefined();
    actionSelect = new Select();
    actionSelect.addItem(i18nManager.getMessage(Messages.PROCESS_COPY));
    actionSelect.addItem(i18nManager.getMessage(Messages.PROCESS_DELETE));
    actionSelect.addItem(i18nManager.getMessage(Messages.PROCESS_DEPLOY));
    actionSelect.addItem(i18nManager.getMessage(Messages.PROCESS_EXPORT));
    actionSelect.setWidth("100px");
    actionSelect.setFilteringMode(Filtering.FILTERINGMODE_OFF);
    actionSelect.setImmediate(true);
    actionSelect.addListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (i18nManager.getMessage(Messages.PROCESS_COPY).equals(event.getProperty().getValue())) {
                ExplorerApp.get().getViewManager().showPopupWindow(new CopyModelPopupWindow(modelData));
            } else if (i18nManager.getMessage(Messages.PROCESS_DELETE).equals(event.getProperty().getValue())) {
                ExplorerApp.get().getViewManager().showPopupWindow(new DeleteModelPopupWindow(modelData));
            } else if (i18nManager.getMessage(Messages.PROCESS_DEPLOY).equals(event.getProperty().getValue())) {
                deployModel();
            } else if (i18nManager.getMessage(Messages.PROCESS_EXPORT).equals(event.getProperty().getValue())) {
                exportModel();
            }
        }
    });
    // Clear toolbar and add 'start' button
    processDefinitionPage.getToolBar().removeAllButtons();
    processDefinitionPage.getToolBar().removeAllAdditionalComponents();
    processDefinitionPage.getToolBar().addButton(newModelButton);
    processDefinitionPage.getToolBar().addButton(importModelButton);
    processDefinitionPage.getToolBar().addButton(editModelButton);
    processDefinitionPage.getToolBar().addAdditionalComponent(actionLabel);
    processDefinitionPage.getToolBar().setComponentAlignment(actionLabel, Alignment.MIDDLE_LEFT);
    processDefinitionPage.getToolBar().addAdditionalComponent(actionSelect);
    processDefinitionPage.getToolBar().setComponentAlignment(actionSelect, Alignment.MIDDLE_RIGHT);
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ValueChangeListener(com.vaadin.data.Property.ValueChangeListener) Button(com.vaadin.ui.Button) ImportModelClickListener(org.activiti.explorer.ui.process.listener.ImportModelClickListener) Label(com.vaadin.ui.Label) Select(com.vaadin.ui.Select) EditModelClickListener(org.activiti.explorer.ui.process.listener.EditModelClickListener) NewModelClickListener(org.activiti.explorer.ui.process.listener.NewModelClickListener)

Aggregations

Button (com.vaadin.ui.Button)2 ImportModelClickListener (org.activiti.explorer.ui.process.listener.ImportModelClickListener)2 NewModelClickListener (org.activiti.explorer.ui.process.listener.NewModelClickListener)2 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)1 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)1 Label (com.vaadin.ui.Label)1 Select (com.vaadin.ui.Select)1 ProcessMenuBar (org.activiti.explorer.ui.process.ProcessMenuBar)1 EditModelClickListener (org.activiti.explorer.ui.process.listener.EditModelClickListener)1