List of usage examples for org.apache.wicket.markup.html.form Check Check
public Check(String id, IModel<T> model, CheckGroup<T> group)
From source file:eu.uqasar.web.dashboard.DashboardSharePage.java
License:Apache License
private Check<User> newShareCheck(final Item<User> item) { return new Check<User>("userCheck", item.getModel(), userGroup) { @Override/*from w ww.j a v a 2 s .c o m*/ protected void onConfigure() { super.onConfigure(); setVisible( !Objects.equals(item.getModelObject().getId(), UQSession.get().getLoggedInUser().getId())); } }; }
From source file:eu.uqasar.web.pages.adapterdata.AdapterManagementPage.java
License:Apache License
/** * Constructor building the page/*from w w w . j a v a2 s . co m*/ * * @param parameters */ public AdapterManagementPage(final PageParameters parameters) { super(parameters); final Form<AdapterSettings> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple products deleteForm.add(adapterGroup = newAdapterSettingsCheckGroup()); // add the container holding list of existing products adapterGroup.add(adapterContainer.setOutputMarkupId(true)); adapterContainer.add(new CheckGroupSelector("adapterGroupSelector", adapterGroup)); DataView<AdapterSettings> adapterSettings = new DataView<AdapterSettings>("adapters", new AdapterProvider(), itemsPerPage) { /** * */ private static final long serialVersionUID = 5487182988227539575L; @Override protected void populateItem(final Item<AdapterSettings> item) { final AdapterSettings adapterSettings = item.getModelObject(); item.add(new Check<>("adapterCheck", item.getModel(), adapterGroup)); item.add(new Label("name", new PropertyModel<String>(adapterSettings, "name"))); item.add(new Label("metricSource", new PropertyModel<String>(adapterSettings, "metricSource"))); item.add(new Label("url", new PropertyModel<String>(adapterSettings, "url"))); item.add(new Label("project", new PropertyModel<Project>(adapterSettings, "project"))); item.add(new Label("latestUpdate", new PropertyModel<Date>(adapterSettings, "latestUpdate"))); item.add(new IndicatingAjaxLink<Object>("updateAdapterData") { private static final long serialVersionUID = 6245494998390009999L; @Override public void onClick(AjaxRequestTarget target) { logger.info("AdapterManagementPage::updateAdapterData()::onClick()"); adapterSettings.updateAdapterData(); viewUpdateSuccessful(target); target.add(adapterContainer); } }); // add button to show AddEditPage item.add(new BookmarkablePageLink<AdapterAddEditPage>("edit", AdapterAddEditPage.class, forAdapter(adapterSettings))); // Depending on the adapter type add a link to the page // where the adapter data can be managed. if (adapterSettings.getMetricSource() == MetricSource.IssueTracker) { item.add(new BookmarkablePageLink<IssueTrackerDataManagementPage>("manage", IssueTrackerDataManagementPage.class, forAdapter(adapterSettings))); } else if (adapterSettings.getMetricSource() == MetricSource.StaticAnalysis) { item.add(new BookmarkablePageLink<StaticAnalysisDataManagementPage>("manage", StaticAnalysisDataManagementPage.class, forAdapter(adapterSettings))); } else if (adapterSettings.getMetricSource() == MetricSource.TestingFramework) { item.add(new BookmarkablePageLink<TestFrameworkDataManagementPage>("manage", TestFrameworkDataManagementPage.class, forAdapter(adapterSettings))); } else if (adapterSettings.getMetricSource() == MetricSource.CubeAnalysis) { item.add(new BookmarkablePageLink<CubeAnalysisDataManagementPage>("manage", CubeAnalysisDataManagementPage.class, forAdapter(adapterSettings))); } else if (adapterSettings.getMetricSource() == MetricSource.VersionControl) { item.add(new BookmarkablePageLink<GitlabDataManagementPage>("manage", GitlabDataManagementPage.class, forAdapter(adapterSettings))); } else if (adapterSettings.getMetricSource() == MetricSource.ContinuousIntegration) { item.add(new BookmarkablePageLink<JenkinsDataManagementPage>("manage", JenkinsDataManagementPage.class, forAdapter(adapterSettings))); } else { item.add(new WebMarkupContainer("manage").setVisible(false)); } } }; // add list of adapters to container adapterContainer.add(adapterSettings); // add button to new adapter settings adapterContainer .add(new BookmarkablePageLink<AdapterAddEditPage>("addAdapterLink", AdapterAddEditPage.class)); // add links for table pagination adapterContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", adapterSettings)); adapterContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", adapterSettings)); // add button to delete selected adapters adapterContainer.add(deleteSelectedButton = newDeleteSelectedButton(adapterGroup)); // add confirmation modal for deleting settings add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.adapterdata.CubeAnalysisDataManagementPage.java
License:Apache License
/** * Constructor building the page//from ww w . ja va 2s . co m * * @param parameters */ public CubeAnalysisDataManagementPage(final PageParameters parameters) { super(parameters); Long adapterId = parameters.get("id").toLongObject(); final Form<CubesMetricMeasurement> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple measurements deleteForm.add(cubesGroup = newCubesCheckGroup()); // add the container holding list of existing measurements cubesGroup.add(cubesContainer.setOutputMarkupId(true)); cubesContainer.add(new CheckGroupSelector("cubesGroupSelector", cubesGroup)); DataView<CubesMetricMeasurement> cubesMeasurements = new DataView<CubesMetricMeasurement>( "cubesMeasurements", new CubesProvider(adapterId), itemsPerPage) { private static final long serialVersionUID = 7687248000895943825L; @Override protected void populateItem(final Item<CubesMetricMeasurement> item) { final CubesMetricMeasurement cubesMetricMeasurement = item.getModelObject(); item.add(new Check<>("cubesCheck", item.getModel(), cubesGroup)); item.add(linkCubesQuery(cubesMetricMeasurement)); item.add(new Label("value", new PropertyModel<String>(cubesMetricMeasurement, "value"))); item.add( new Label("jsonContent", new PropertyModel<String>(cubesMetricMeasurement, "jsonContent"))); item.add(new Label("timeStamp", new PropertyModel<Date>(cubesMetricMeasurement, "timeStamp"))); // add button to show AddEditPage item.add(new BookmarkablePageLink<CubeAnalysisDataManagementEditPage>("edit", CubeAnalysisDataManagementEditPage.class, forTableEntity(cubesMetricMeasurement, parameters))); } }; cubesContainer.add(cubesMeasurements); // add links for table pagination cubesContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", cubesMeasurements)); cubesContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", cubesMeasurements)); // add button to delete selected items cubesContainer.add(deleteSelectedButton = newDeleteSelectedButton(cubesGroup)); // add confirmation modal for deleting items add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.adapterdata.GitlabDataManagementPage.java
License:Apache License
/** * Constructor building the page/*from w w w .j a v a 2 s.c o m*/ * * @param parameters */ public GitlabDataManagementPage(final PageParameters parameters) { super(parameters); Long adapterId = parameters.get("id").toLongObject(); final Form<GitlabMetricMeasurement> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple products deleteForm.add(gitlabGroup = newGitlabCheckGroup()); // add the container holding list of existing products gitlabGroup.add(gitlabContainer.setOutputMarkupId(true)); gitlabContainer.add(new CheckGroupSelector("gitlabGroupSelector", gitlabGroup)); DataView<GitlabMetricMeasurement> gitlabMeasurements = new DataView<GitlabMetricMeasurement>( "gitlabMeasurements", new GitlabProvider(adapterId), itemsPerPage) { @Override protected void populateItem(final Item<GitlabMetricMeasurement> item) { final GitlabMetricMeasurement gitlabMetricMeasurement = item.getModelObject(); item.add(new Check<>("gitlabCheck", item.getModel(), gitlabGroup)); item.add(new Label("name", new PropertyModel<String>(gitlabMetricMeasurement, "name"))); item.add(new Label("metric", new PropertyModel<String>(gitlabMetricMeasurement, "gitlabMetric"))); item.add(new Label("value", new PropertyModel<String>(gitlabMetricMeasurement, "value"))); item.add(new Label("timeStamp", new PropertyModel<Date>(gitlabMetricMeasurement, "timeStamp"))); } }; gitlabContainer.add(gitlabMeasurements); // add links for table pagination gitlabContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", gitlabMeasurements)); gitlabContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", gitlabMeasurements)); // add button to delete selected items gitlabContainer.add(deleteSelectedButton = newDeleteSelectedButton(gitlabGroup)); // add confirmation modal for deleting products add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.adapterdata.IssueTrackerDataManagementPage.java
License:Apache License
/** * Constructor building the page// ww w . j a v a 2 s .c om * * @param parameters */ public IssueTrackerDataManagementPage(final PageParameters parameters) { super(parameters); Long adapterId = parameters.get("id").toLongObject(); final Form<JiraMetricMeasurement> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple measurements deleteForm.add(jiraGroup = newJiraCheckGroup()); // add the container holding list of existing measurements jiraGroup.add(jiraContainer.setOutputMarkupId(true)); jiraContainer.add(new CheckGroupSelector("jiraGroupSelector", jiraGroup)); DataView<JiraMetricMeasurement> jiraMeasurements = new DataView<JiraMetricMeasurement>("jiraMeasurements", new JiraProvider(adapterId), itemsPerPage) { private static final long serialVersionUID = -2997007102890828835L; @Override protected void populateItem(final Item<JiraMetricMeasurement> item) { final JiraMetricMeasurement jiraMetricMeasurement = item.getModelObject(); item.add(new Check<>("jiraCheck", item.getModel(), jiraGroup)); item.add(new Label("key", new PropertyModel<String>(jiraMetricMeasurement, "jiraKey"))); item.add(new Label("self", new PropertyModel<String>(jiraMetricMeasurement, "self"))); item.add(new Label("jiraMetric", new PropertyModel<String>(jiraMetricMeasurement, "jiraMetric"))); item.add(new Label("jsonContent", new PropertyModel<String>(jiraMetricMeasurement, "jsonContent"))); item.add(new Label("timeStamp", new PropertyModel<Date>(jiraMetricMeasurement, "timeStamp"))); // add button to show AddEditPage item.add(new BookmarkablePageLink<IssueTrackerDataManagementEditPage>("edit", IssueTrackerDataManagementEditPage.class, forTableEntity(jiraMetricMeasurement, parameters))); } }; jiraContainer.add(jiraMeasurements); // add links for table pagination jiraContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", jiraMeasurements)); jiraContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", jiraMeasurements)); // add button to delete selected items jiraContainer.add(deleteSelectedButton = newDeleteSelectedButton(jiraGroup)); // add confirmation modal for deleting products add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.adapterdata.JenkinsDataManagementPage.java
License:Apache License
/** * Constructor building the page//from w ww . j a v a 2 s . c o m * * @param parameters */ public JenkinsDataManagementPage(final PageParameters parameters) { super(parameters); Long adapterId = parameters.get("id").toLongObject(); final Form<JenkinsMetricMeasurement> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple products deleteForm.add(jenkinsGroup = newJenkinsCheckGroup()); // add the container holding list of existing products jenkinsGroup.add(jenkinsContainer.setOutputMarkupId(true)); jenkinsContainer.add(new CheckGroupSelector("jenkinsGroupSelector", jenkinsGroup)); DataView<JenkinsMetricMeasurement> jenkinsMeasurements = new DataView<JenkinsMetricMeasurement>( "jenkinsMeasurements", new JenkinsProvider(adapterId), itemsPerPage) { @Override protected void populateItem(final Item<JenkinsMetricMeasurement> item) { final JenkinsMetricMeasurement jenkinsMetricMeasurement = item.getModelObject(); item.add(new Check<>("jenkinsCheck", item.getModel(), jenkinsGroup)); item.add(new Label("name", new PropertyModel<String>(jenkinsMetricMeasurement, "name"))); item.add(new Label("metric", new PropertyModel<String>(jenkinsMetricMeasurement, "jenkinsMetric"))); item.add(new Label("value", new PropertyModel<String>(jenkinsMetricMeasurement, "value"))); item.add(new Label("timeStamp", new PropertyModel<Date>(jenkinsMetricMeasurement, "timeStamp"))); // add button to show AddEditPage item.add(new BookmarkablePageLink<JenkinsDataManagementEditPage>("edit", JenkinsDataManagementEditPage.class, forTableEntity(jenkinsMetricMeasurement, parameters))); } }; jenkinsContainer.add(jenkinsMeasurements); // add links for table pagination jenkinsContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", jenkinsMeasurements)); jenkinsContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", jenkinsMeasurements)); // add button to delete selected items jenkinsContainer.add(deleteSelectedButton = newDeleteSelectedButton(jenkinsGroup)); // add confirmation modal for deleting products add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.adapterdata.StaticAnalysisDataManagementPage.java
License:Apache License
/** * Constructor building the page/*w w w . j a va 2 s . c o m*/ * * @param parameters */ public StaticAnalysisDataManagementPage(final PageParameters parameters) { super(parameters); Long adapterId = parameters.get("id").toLongObject(); final Form<SonarMetricMeasurement> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple products deleteForm.add(sonarGroup = newSonarCheckGroup()); // add the container holding list of existing products sonarGroup.add(sonarContainer.setOutputMarkupId(true)); sonarContainer.add(new CheckGroupSelector("sonarGroupSelector", sonarGroup)); DataView<SonarMetricMeasurement> sonarMeasurements = new DataView<SonarMetricMeasurement>( "sonarMeasurements", new SonarProvider(adapterId), itemsPerPage) { private static final long serialVersionUID = -392205969465703229L; @Override protected void populateItem(final Item<SonarMetricMeasurement> item) { final SonarMetricMeasurement sonarMetricMeasurement = item.getModelObject(); item.add(new Check<>("sonarCheck", item.getModel(), sonarGroup)); item.add(new Label("name", new PropertyModel<String>(sonarMetricMeasurement, "name"))); item.add(new Label("key", new PropertyModel<String>(sonarMetricMeasurement, "sonarKey"))); item.add(new Label("metric", new PropertyModel<String>(sonarMetricMeasurement, "sonarMetric"))); item.add(new Label("value", new PropertyModel<String>(sonarMetricMeasurement, "value"))); item.add(new Label("timeStamp", new PropertyModel<Date>(sonarMetricMeasurement, "timeStamp"))); // add button to show AddEditPage item.add(new BookmarkablePageLink<StaticAnalysisDataManagementEditPage>("edit", StaticAnalysisDataManagementEditPage.class, forTableEntity(sonarMetricMeasurement, parameters))); } }; sonarContainer.add(sonarMeasurements); // add links for table pagination sonarContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", sonarMeasurements)); sonarContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", sonarMeasurements)); // add button to delete selected items sonarContainer.add(deleteSelectedButton = newDeleteSelectedButton(sonarGroup)); // add confirmation modal for deleting products add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.adapterdata.TestFrameworkDataManagementPage.java
License:Apache License
/** * Constructor building the page/*from w ww. ja v a 2 s.co m*/ * * @param parameters */ public TestFrameworkDataManagementPage(final PageParameters parameters) { super(parameters); Long adapterId = parameters.get("id").toLongObject(); final Form<TestLinkMetricMeasurement> deleteForm = new Form<>("deleteForm"); add(deleteForm); // add checkgroup for selecting multiple products deleteForm.add(testLinkGroup = newTestLinkCheckGroup()); // add the container holding list of existing products testLinkGroup.add(testLinkContainer.setOutputMarkupId(true)); testLinkContainer.add(new CheckGroupSelector("testLinkGroupSelector", testLinkGroup)); DataView<TestLinkMetricMeasurement> testLinkMeasurements = new DataView<TestLinkMetricMeasurement>( "testLinkMeasurements", new TestLinkProvider(adapterId), itemsPerPage) { /** * */ private static final long serialVersionUID = -4323485288017314459L; @Override protected void populateItem(final Item<TestLinkMetricMeasurement> item) { final TestLinkMetricMeasurement testLinkMetricMeasurement = item.getModelObject(); item.add(new Check<>("testLinkCheck", item.getModel(), testLinkGroup)); item.add(new Label("name", new PropertyModel<String>(testLinkMetricMeasurement, "name"))); item.add(new Label("key", new PropertyModel<String>(testLinkMetricMeasurement, "testLinkKey"))); item.add(new Label("metric", new PropertyModel<String>(testLinkMetricMeasurement, "testLinkMetric"))); item.add(new Label("value", new PropertyModel<String>(testLinkMetricMeasurement, "value"))); item.add(new Label("timeStamp", new PropertyModel<Date>(testLinkMetricMeasurement, "timeStamp"))); // add button to show AddEditPage item.add(new BookmarkablePageLink<TestFrameworkDataManagementEditPage>("edit", TestFrameworkDataManagementEditPage.class, forTableEntity(testLinkMetricMeasurement, parameters))); } }; testLinkContainer.add(testLinkMeasurements); // add links for table pagination testLinkContainer.add(new BootstrapAjaxPagingNavigator("navigatorHead", testLinkMeasurements)); testLinkContainer.add(new BootstrapAjaxPagingNavigator("navigatorFoot", testLinkMeasurements)); // add button to delete selected items testLinkContainer.add(deleteSelectedButton = newDeleteSelectedButton(testLinkGroup)); // add confirmation modal for deleting products add(deleteConfirmationModal = newDeleteConfirmationModal()); }
From source file:eu.uqasar.web.pages.admin.companies.CompanyListPage.java
License:Apache License
private Check<Company> newDeleteCheck(final Item<Company> item) { return new Check<Company>("companyCheck", item.getModel(), companyGroup) { @Override/*from w ww . j a v a 2 s .c o m*/ protected void onConfigure() { super.onConfigure(); setVisible( !Objects.equals(item.getModelObject().getId(), UQSession.get().getLoggedInUser().getId())); } }; }
From source file:eu.uqasar.web.pages.admin.meta.MetaDataEditPanel.java
License:Apache License
private DataView<T> getListing() { return new DataView<T>("data", getMetaDataProvider(this.clazz)) { @Override/* ww w . j a va 2s. c om*/ protected void populateItem(Item<T> item) { Check<T> check = new Check<>("check", item.getModel(), checkGroup); item.add(check); TextField nameField = new TextField("name", new PropertyModel(item.getModel(), "name")); item.add(new InputBeanValidationBorder<>("nameValidationBorder", nameField)); item.add(newIsInUseIndicator("inUse", item.getModelObject())); } }; }