List of usage examples for org.apache.wicket.extensions.markup.html.repeater.data.table.filter GoAndClearFilter GoAndClearFilter
public GoAndClearFilter(final String id, final FilterForm<?> form)
From source file:org.cipango.ims.hss.web.privateid.PrivateIdBrowserPage.java
License:Apache License
@SuppressWarnings("unchecked") public PrivateIdBrowserPage() { super(null);// w w w. j a va 2 s.co m IColumn[] columns = new IColumn[3]; columns[0] = new PropertyColumn(new StringResourceModel(getPrefix() + ".name", this, null), "identity"); columns[1] = new AbstractColumn(new StringResourceModel(getPrefix() + ".publicIds", this, null)) { public void populateItem(Item cellItem, String componentId, IModel model) { PrivateIdentity identity = (PrivateIdentity) model.getObject(); cellItem.add(new Label(componentId, String.valueOf(identity.getPublicIdentities().size()))); } }; columns[2] = new FilteredAbstractColumn(new Model("Actions")) { public void populateItem(Item cellItem, String componentId, IModel model) { final PrivateIdentity id = (PrivateIdentity) model.getObject(); cellItem.add(new ActionsPanel(componentId, id)); } // return the go-and-clear filter for the filter toolbar public Component getFilter(String componentId, FilterForm form) { return new GoAndClearFilter(componentId, form); } }; DefaultDataTable table = new DefaultDataTable("browser", columns, new DaoDataProvider("identity"), 15); add(table); setContextMenu(new IdentitiesContextPanel()); }
From source file:org.cipango.ims.hss.web.publicid.PublicIdBrowserPage.java
License:Apache License
@SuppressWarnings("unchecked") public PublicIdBrowserPage(PageParameters pageParameters) { super(pageParameters); String serviceProfile = pageParameters.getString("serviceProfile"); String applicationServer = pageParameters.getString("applicationServer"); String scscf = pageParameters.getString("scscf"); String search = pageParameters.getString("search"); addSearchField(search);/* w w w . j a va 2 s .com*/ add(new BookmarkablePageLink("createLink", EditPublicUserIdPage.class)); add(new BookmarkablePageLink("createPsiLink", EditPsiPage.class)); IColumn[] columns = new IColumn[5]; columns[0] = new PropertyColumn(new StringResourceModel(getPrefix() + ".name", this, null), "identity", "identity"); columns[1] = new PropertyColumn(new StringResourceModel(getPrefix() + ".barred", this, null), "barred", "barred"); columns[2] = new PropertyColumn(new StringResourceModel(getPrefix() + ".identityType", this, null), "TYPE,regex", "identityTypeAsString"); columns[3] = new PropertyColumn(new StringResourceModel(getPrefix() + ".state", this, null), "stateAsString"); columns[4] = new FilteredAbstractColumn(new Model("Actions")) { public void populateItem(Item cellItem, String componentId, IModel model) { final PublicIdentity id = (PublicIdentity) model.getObject(); cellItem.add(new ActionsPanel(componentId, id)); } // return the go-and-clear filter for the filter toolbar public Component getFilter(String componentId, FilterForm form) { return new GoAndClearFilter(componentId, form); } }; DaoDataProvider daoDataProvider = new DaoDataProvider("identity", serviceProfile, applicationServer, scscf, search); DefaultDataTable table = new DefaultDataTable("browser", columns, daoDataProvider, getItemByPage()); add(table); serviceProfile = daoDataProvider.getServiceProfile(); applicationServer = daoDataProvider.getApplicationServer(); scscf = daoDataProvider.getScscf(); if (!Strings.isEmpty(serviceProfile)) { setContextMenu(new ContextPanel(_serviceProfileDao.findById(serviceProfile))); _title = MapVariableInterpolator.interpolate(getString("serviceProfile.publicIds.browser.title"), new MicroMap("name", serviceProfile)); } else if (!Strings.isEmpty(applicationServer)) { setContextMenu( new org.cipango.ims.hss.web.as.ContextPanel(_applicationServerDao.findById(applicationServer))); _title = MapVariableInterpolator.interpolate(getString("as.psi.browser.title"), new MicroMap("name", applicationServer)); } else if (!Strings.isEmpty(scscf)) { setContextMenu(new org.cipango.ims.hss.web.scscf.ContextPanel(_scscfDao.findById(scscf))); _title = MapVariableInterpolator.interpolate(getString("scscf.psi.browser.title"), new MicroMap("name", scscf)); } else _title = getString(getPrefix() + ".browser.title"); add(new Label("title", _title)); setContextMenu(new IdentitiesContextPanel()); }
From source file:org.cipango.ims.hss.web.serviceprofile.ServiceProfileBrowserPage.java
License:Apache License
@SuppressWarnings("unchecked") public ServiceProfileBrowserPage(PageParameters pageParameters) { super(pageParameters); String ifcName = pageParameters.getString("ifc"); add(new BookmarkablePageLink("createLink", EditServiceProfilePage.class)); IColumn[] columns = new IColumn[4]; columns[0] = new PropertyColumn(new StringResourceModel(getPrefix() + ".name", this, null), "name", "name"); columns[1] = new AbstractColumn(new StringResourceModel(getPrefix() + ".nbPublicIds", this, null)) { public void populateItem(Item cellItem, String componentId, IModel model) { cellItem.add(new NbPublicIdsPanel(componentId, (ServiceProfile) model.getObject())); }/*from w ww .j a v a 2 s .c om*/ }; columns[2] = new AbstractColumn(new StringResourceModel(getPrefix() + ".ifcs", this, null)) { public void populateItem(Item cellItem, String componentId, IModel model) { ServiceProfile sp = (ServiceProfile) model.getObject(); cellItem.add(new Label(componentId, String.valueOf(sp.getAllIfcs().size()))); } }; columns[3] = new FilteredAbstractColumn(new Model("Actions")) { public void populateItem(Item cellItem, String componentId, IModel model) { ServiceProfile id = (ServiceProfile) model.getObject(); cellItem.add(new ActionsPanel(componentId, id)); } public Component getFilter(String componentId, FilterForm form) { return new GoAndClearFilter(componentId, form); } }; DaoDataProvider daoDataProvider = new DaoDataProvider("name", ifcName); DefaultDataTable table = new DefaultDataTable("browser", columns, daoDataProvider, getItemByPage()); add(table); ifcName = daoDataProvider.getIfc(); if (!Strings.isEmpty(ifcName)) { setContextMenu(new ContextPanel(_ifcDao.findById(ifcName))); _title = MapVariableInterpolator.interpolate(getString("ifc.serviceProfile.browser.title"), new MicroMap("name", ifcName)); } else _title = getString(getPrefix() + ".browser.title"); add(new Label("title", _title)); setContextMenu(new ServicesContextPanel()); }
From source file:org.cipango.ims.hss.web.subscription.SubscriptionBrowserPage.java
License:Apache License
@SuppressWarnings("unchecked") public SubscriptionBrowserPage(PageParameters pageParameters) { super(pageParameters); String scscf = pageParameters.getString("scscf"); add(new BookmarkablePageLink("createLink", AddSubscriptionPage.class)); IColumn[] columns = new IColumn[5]; columns[0] = new PropertyColumn(new StringResourceModel(getPrefix() + ".name", this, null), "name", "name"); columns[1] = new PropertyColumn(new StringResourceModel(getPrefix() + ".scscf", this, null), "scscf", "scscf"); columns[2] = new PropertyColumn(new Model(getString("contextPanel.privateIdentities")), null) { public void populateItem(Item cellItem, String componentId, IModel model) { final Subscription id = (Subscription) model.getObject(); cellItem.add(new IdentityPanel(componentId, id.getPrivateIds(), false)); }//from ww w. java 2 s . c o m }; columns[3] = new PropertyColumn(new Model(getString("contextPanel.publicIdentities")), null) { public void populateItem(Item cellItem, String componentId, IModel model) { final Subscription id = (Subscription) model.getObject(); cellItem.add(new IdentityPanel(componentId, id.getPublicIds(), true)); } }; columns[4] = new FilteredAbstractColumn(new Model(getString("actions"))) { public void populateItem(Item cellItem, String componentId, IModel model) { final Subscription id = (Subscription) model.getObject(); cellItem.add(new ActionsPanel(componentId, id)); } public Component getFilter(String componentId, FilterForm form) { return new GoAndClearFilter(componentId, form); } }; DaoDataProvider daoDataProvider = new DaoDataProvider("name", scscf); DefaultDataTable table = new DefaultDataTable("browser", columns, daoDataProvider, getItemByPage()); table.setOutputMarkupId(true); add(table); scscf = daoDataProvider.getScscf(); if (!Strings.isEmpty(scscf)) { setContextMenu(new ContextPanel(_scscfDao.findById(scscf))); _title = MapVariableInterpolator.interpolate(getString("scscf.subscriptions.browser.title"), new MicroMap("name", scscf)); } else _title = getString(getPrefix() + ".browser.title"); add(new Label("title", _title)); setContextMenu(new IdentitiesContextPanel()); }
From source file:org.openengsb.ui.common.taskbox.web.TaskOverviewPanel.java
License:Apache License
public TaskOverviewPanel(String id) { super(id);//from www.j av a2 s. c om ArrayList<IColumn<Task>> columns = new ArrayList<IColumn<Task>>(); IColumn<Task> actionsColumn = new FilteredAbstractColumn<Task>(Model.of("Actions")) { @Override public Component getFilter(String componentId, FilterForm<?> form) { return new GoAndClearFilter(componentId, form); } @Override @SuppressWarnings("rawtypes") public void populateItem(Item cellItem, String componentId, IModel rowModel) { final Task task = (Task) rowModel.getObject(); cellItem.add(new UserActionsPanel(componentId, task)); } }; columns.add(actionsColumn); columns.add(new TextFilteredPropertyColumn<Task, String>(Model.of("TaskId"), "taskId", "taskId")); columns.add(new TextFilteredPropertyColumn<Task, String>(Model.of("TaskType"), "taskType", "taskType")); columns.add(new TextFilteredPropertyColumn<Task, String>(Model.of("Description"), "description", "description")); columns.add(new PropertyColumn<Task>(Model.of("TaskCreationTimestamp"), "taskCreationTimestamp", "taskCreationTimestamp")); FilterForm<Object> form = new FilterForm<Object>("form", dataProvider); DefaultDataTable<Task> dataTable = new DefaultDataTable<Task>("dataTable", columns, dataProvider, 15); dataTable.addTopToolbar(new FilterToolbar(dataTable, form, dataProvider)); form.add(dataTable); add(form); add(panel); }