Search in sources :

Example 6 with ValueChangeEvent

use of com.vaadin.data.Property.ValueChangeEvent in project Activiti by Activiti.

the class ProcessInstancePage method createList.

@Override
protected Table createList() {
    final Table processInstanceTable = new Table();
    processInstanceTable.addStyleName(ExplorerLayout.STYLE_PROCESS_INSTANCE_LIST);
    // Listener to change right panel when clicked on a process instance
    processInstanceTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 8811553575319455854L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = processInstanceTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String processInstanceId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new ProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
                UriFragment taskFragment = getUriFragment(processInstanceId);
                ExplorerApp.get().setCurrentUriFragment(taskFragment);
            } else {
                // Nothing is selected
                setDetailComponent(null);
                UriFragment taskFragment = getUriFragment(null);
                ExplorerApp.get().setCurrentUriFragment(taskFragment);
            }
        }
    });
    this.lazyLoadingQuery = createLazyLoadingQuery();
    this.processInstanceListContainer = new LazyLoadingContainer(lazyLoadingQuery, 30);
    processInstanceTable.setContainerDataSource(processInstanceListContainer);
    // Create column header
    processInstanceTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
    processInstanceTable.setColumnWidth("icon", 22);
    processInstanceTable.addContainerProperty("name", String.class, null);
    processInstanceTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return processInstanceTable;
}
Also used : Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ProcessInstanceDetailPanel(org.activiti.explorer.ui.management.processinstance.ProcessInstanceDetailPanel) Table(com.vaadin.ui.Table) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) Property(com.vaadin.data.Property) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 7 with ValueChangeEvent

use of com.vaadin.data.Property.ValueChangeEvent in project Activiti by Activiti.

the class SimpleTableEditor method initButtons.

protected void initButtons(GridLayout layout) {
    final Button saveButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_EDITOR_SAVE));
    saveButton.setEnabled(nameField.getValue() != null && !"".equals((String) nameField.getValue()));
    toolBar.addButton(saveButton);
    saveButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            save();
        }
    });
    // Dependending on namefield value, save button is enabled
    nameField.addListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            if (nameField.getValue() != null && !"".equals((String) nameField.getValue())) {
                saveButton.setEnabled(true);
            } else {
                saveButton.setEnabled(false);
            }
        }
    });
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ValueChangeListener(com.vaadin.data.Property.ValueChangeListener) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 8 with ValueChangeEvent

use of com.vaadin.data.Property.ValueChangeEvent in project Activiti by Activiti.

the class SavedReportsPage method createList.

protected Table createList() {
    reportTable = new Table();
    reportListQuery = new SavedReportsListQuery();
    reportListContainer = new LazyLoadingContainer(reportListQuery);
    reportTable.setContainerDataSource(reportListContainer);
    // Column headers
    reportTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.REPORT_22));
    reportTable.setColumnWidth("icon", 22);
    reportTable.addContainerProperty("name", String.class, null);
    reportTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    // Listener to change right panel when clicked on a report
    reportTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = reportTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String historicProcessInstanceId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new SavedReportDetailPanel(historicProcessInstanceId));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART, historicProcessInstanceId));
            } else {
                // Nothing selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART));
            }
        }
    });
    return reportTable;
}
Also used : Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) Table(com.vaadin.ui.Table) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) Property(com.vaadin.data.Property) UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 9 with ValueChangeEvent

use of com.vaadin.data.Property.ValueChangeEvent in project Activiti by Activiti.

the class AccountSelectionPopup method initImapComponent.

protected void initImapComponent() {
    imapForm = new Form();
    imapForm.setDescription(i18nManager.getMessage(Messages.IMAP_DESCRIPTION));
    final TextField imapServer = new TextField(i18nManager.getMessage(Messages.IMAP_SERVER));
    imapForm.getLayout().addComponent(imapServer);
    final TextField imapPort = new TextField(i18nManager.getMessage(Messages.IMAP_PORT));
    imapPort.setWidth(30, UNITS_PIXELS);
    // Default imap port (non-ssl)
    imapPort.setValue(143);
    imapForm.getLayout().addComponent(imapPort);
    final CheckBox useSSL = new CheckBox(i18nManager.getMessage(Messages.IMAP_SSL));
    useSSL.setValue(false);
    useSSL.setImmediate(true);
    imapForm.getLayout().addComponent(useSSL);
    useSSL.addListener(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            imapPort.setValue(((Boolean) useSSL.getValue()) ? 993 : 143);
        }
    });
    final TextField imapUserName = new TextField(i18nManager.getMessage(Messages.IMAP_USERNAME));
    imapForm.getLayout().addComponent(imapUserName);
    final PasswordField imapPassword = new PasswordField(i18nManager.getMessage(Messages.IMAP_PASSWORD));
    imapForm.getLayout().addComponent(imapPassword);
    // Matching listener
    imapClickListener = new ClickListener() {

        public void buttonClick(ClickEvent event) {
            Map<String, Object> accountDetails = createAccountDetails("imap", imapUserName.getValue().toString(), imapPassword.getValue().toString(), "server", imapServer.getValue().toString(), "port", imapPort.getValue().toString(), "ssl", imapPort.getValue().toString());
            fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
        }
    };
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ValueChangeListener(com.vaadin.data.Property.ValueChangeListener) Form(com.vaadin.ui.Form) CheckBox(com.vaadin.ui.CheckBox) ClickEvent(com.vaadin.ui.Button.ClickEvent) TextField(com.vaadin.ui.TextField) PasswordField(com.vaadin.ui.PasswordField) HashMap(java.util.HashMap) Map(java.util.Map) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Example 10 with ValueChangeEvent

use of com.vaadin.data.Property.ValueChangeEvent in project Activiti by Activiti.

the class JobPage method createList.

@Override
protected Table createList() {
    final Table jobTable = new Table();
    LazyLoadingQuery jobListQuery = new JobListQuery();
    jobListContainer = new LazyLoadingContainer(jobListQuery, 30);
    jobTable.setContainerDataSource(jobListContainer);
    // Listener to change right panel when clicked on a deployment
    jobTable.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 8811553575319455854L;

        public void valueChange(ValueChangeEvent event) {
            // the value of the property is the itemId of the table entry
            Item item = jobTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String jobId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new JobDetailPanel(jobId, JobPage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(JobNavigator.JOB_URL_PART, jobId));
            } else {
                // Nothing is selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(JobNavigator.JOB_URL_PART));
            }
        }
    });
    // Create column headers
    jobTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.JOB_22));
    jobTable.setColumnWidth("icon", 22);
    jobTable.addContainerProperty("name", String.class, null);
    jobTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return jobTable;
}
Also used : Table(com.vaadin.ui.Table) LazyLoadingContainer(org.activiti.explorer.data.LazyLoadingContainer) UriFragment(org.activiti.explorer.navigation.UriFragment) Item(com.vaadin.data.Item) ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ThemeImageColumnGenerator(org.activiti.explorer.ui.util.ThemeImageColumnGenerator) Property(com.vaadin.data.Property) LazyLoadingQuery(org.activiti.explorer.data.LazyLoadingQuery)

Aggregations

ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)30 Table (com.vaadin.ui.Table)21 Item (com.vaadin.data.Item)20 Property (com.vaadin.data.Property)19 UriFragment (org.activiti.explorer.navigation.UriFragment)13 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)11 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)11 ThemeImageColumnGenerator (org.activiti.explorer.ui.util.ThemeImageColumnGenerator)10 Label (com.vaadin.ui.Label)6 ClickEvent (com.vaadin.ui.Button.ClickEvent)5 Button (com.vaadin.ui.Button)4 ClickListener (com.vaadin.ui.Button.ClickListener)4 HistoricProcessInstance (org.activiti.engine.history.HistoricProcessInstance)4 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)4 CheckBox (com.vaadin.ui.CheckBox)3 HorizontalLayout (com.vaadin.ui.HorizontalLayout)3 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)3 CellStyleGenerator (com.vaadin.ui.Table.CellStyleGenerator)2 HistoricFormProperty (org.activiti.engine.history.HistoricFormProperty)2 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)2