Search in sources :

Example 16 with ValueChangeEvent

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

the class GroupPage method createList.

protected Table createList() {
    groupTable = new Table();
    groupTable.setEditable(false);
    groupTable.setImmediate(true);
    groupTable.setSelectable(true);
    groupTable.setNullSelectionAllowed(false);
    groupTable.setSortDisabled(true);
    groupTable.setSizeFull();
    groupListQuery = new GroupListQuery();
    groupListContainer = new LazyLoadingContainer(groupListQuery, 30);
    groupTable.setContainerDataSource(groupListContainer);
    // Column headers
    groupTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.GROUP_22));
    groupTable.setColumnWidth("icon", 22);
    groupTable.addContainerProperty("name", String.class, null);
    groupTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    // Listener to change right panel when clicked on a user
    groupTable.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 = groupTable.getItem(event.getProperty().getValue());
            if (item != null) {
                String groupId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new GroupDetailPanel(GroupPage.this, groupId));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
            } else {
                // Nothing is selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
            }
        }
    });
    return groupTable;
}
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 17 with ValueChangeEvent

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

the class DatabasePage method createList.

@Override
protected Table createList() {
    final Table tableList = new Table();
    // Listener to change right panel when clicked on a task
    tableList.addListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 8811553575319455854L;

        public void valueChange(ValueChangeEvent event) {
            // The itemId of the table list is the tableName
            String tableName = (String) event.getProperty().getValue();
            setDetailComponent(new DatabaseDetailPanel(tableName));
            // Update URL
            ExplorerApp.get().setCurrentUriFragment(new UriFragment(DatabaseNavigator.TABLE_URI_PART, tableName));
        }
    });
    // Create column headers
    tableList.addContainerProperty("icon", Embedded.class, null);
    tableList.setColumnWidth("icon", 22);
    tableList.addContainerProperty("tableName", String.class, null);
    tableList.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return tableList;
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) Table(com.vaadin.ui.Table) Property(com.vaadin.data.Property) UriFragment(org.activiti.explorer.navigation.UriFragment)

Example 18 with ValueChangeEvent

use of com.vaadin.data.Property.ValueChangeEvent in project opennms by OpenNMS.

the class SimpleViewContribution method getView.

@SuppressWarnings("serial")
@Override
public Component getView(final WidgetContext widgetContext) {
    ListSelect listSelect = new ListSelect("Select a city", cities);
    listSelect.setHeight("100%");
    listSelect.setWidth("100%");
    listSelect.setImmediate(true);
    listSelect.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            Notification.show("" + event.getProperty());
        }
    });
    return listSelect;
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ValueChangeListener(com.vaadin.data.Property.ValueChangeListener) ListSelect(com.vaadin.ui.ListSelect)

Example 19 with ValueChangeEvent

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

the class RunReportsPage method createList.

protected Table createList() {
    reportTable = new Table();
    reportListQuery = new ReportListQuery();
    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 processDefinitionId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new ReportDetailPanel(processDefinitionId, RunReportsPage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ReportNavigator.REPORT_URI_PART, processDefinitionId));
            } else {
                // Nothing selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ReportNavigator.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 20 with ValueChangeEvent

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

the class ProcessInstancePage method createList.

protected Table createList() {
    final Table table = new Table();
    LazyLoadingQuery query = new ProcessInstanceListQuery();
    processInstanceContainer = new LazyLoadingContainer(query);
    table.setContainerDataSource(processInstanceContainer);
    table.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 = table.getItem(event.getProperty().getValue());
            if (item != null) {
                String processInstanceId = (String) item.getItemProperty("id").getValue();
                setDetailComponent(new AlfrescoProcessInstanceDetailPanel(processInstanceId, ProcessInstancePage.this));
                // Update URL
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART, processInstanceId));
            } else {
                // Nothing is selected
                setDetailComponent(null);
                ExplorerApp.get().setCurrentUriFragment(new UriFragment(ProcessInstanceNavigator.PROCESS_INSTANCE_URL_PART));
            }
        }
    });
    // Create column headers
    table.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
    table.setColumnWidth("icon", 22);
    table.addContainerProperty("name", String.class, null);
    table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    return table;
}
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