Java Code Examples for org.apache.wicket.model.CompoundPropertyModel

The following are top voted examples for showing how to use org.apache.wicket.model.CompoundPropertyModel. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GeoCrawler   File: SeedPage.java   Source Code and License 7 votes vote down vote up
private void addUrlForm() {
  urlForm = new Form<SeedUrl>("urlForm", CompoundPropertyModel.of(Model
      .of(new SeedUrl())));
  urlForm.setOutputMarkupId(true);
  urlForm.add(new TextField<String>("url"));
  urlForm.add(new AjaxSubmitLink("addUrl", urlForm) {
    @Override
    protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
      addSeedUrl();
      urlForm.setModelObject(new SeedUrl());
      target.add(urlForm);
      target.add(seedUrlsTable);
    }
  });
  add(urlForm);
}
 
Example 2
Project: karate   File: PostmanConvertPanel.java   Source Code and License 6 votes vote down vote up
public PostmanConvertPanel(String id) {
    super(id);
    setDefaultModel(new CompoundPropertyModel(this));
    Form form = new Form("form") {
        @Override
        protected void onSubmit() {
            logger.debug("text is: {}", text);
            List<PostmanRequest> requests = ConvertUtils.readPostmanJson(text);
            String feature = ConvertUtils.toKarateFeature(requests);
            KarateSession session = service.createSession("dev", feature);
            setResponsePage(new FeaturePage(session.getId()));
        }
    };
    form.add(new TextArea("text"));
    add(form);
    add(new FeedbackPanel("feedback"));
    text = "Paste your postman collection here.";
}
 
Example 3
Project: vlo-curation   File: FacetValuesPanel.java   Source Code and License 6 votes vote down vote up
/**
 * Adds an individual facet value selection link to a dataview item
 *
 * @param item item to add link to
 */
private void addFacetValue(String id, final ListItem<Count> item) {
    item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));

    // link to select an individual facet value
    final Link selectLink = new IndicatingAjaxFallbackLink(id) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            // reset filter
            ((NameAndCountFieldValuesFilter) filterModel.getObject()).setName(null);

            // call callback
            onValuesSelected(
                    // for now only single values can be selected
                    Collections.singleton(item.getModelObject().getName()),
                    target);
        }
    };
    item.add(selectLink);

    // 'name' field from Count (name of value)
    selectLink.add(new FieldValueLabel("name", fieldNameModel));
    // 'count' field from Count (document count for value)
    selectLink.add(new Label("count"));
}
 
Example 4
Project: Intercloud   File: LoginPanel.java   Source Code and License 6 votes vote down vote up
public LoginForm(String markupId) {
    super(markupId);
    this.setDefaultModel(new CompoundPropertyModel<Object>(this));

    this.add(new TextField("username").setRequired(true));
    this.add(new PasswordTextField("password").setRequired(true));

    Button submitBtn = new AjaxButton("loginBtn", Model.of("Sign In")) {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            if (AuthenticatedWebSession.get().signIn(username, password))
                setResponsePage(DiscoverItemsPage.class);
            else {
                target.add(ComponentUtils.displayBlock(alert));
            }
        }
    };
    this.add(submitBtn);
    this.setDefaultButton(submitBtn);
}
 
Example 5
Project: openmeetings   File: EmailForm.java   Source Code and License 6 votes vote down vote up
public EmailForm(String id, final WebMarkupContainer list, MailMessage m) {
	super(id, new CompoundPropertyModel<>(m));
	this.list = list;
	add(status = new Label("status", Model.of("")));
	add(new Label("subject"));
	add(new Label("recipients"));
	add(new Label("body").setEscapeModelStrings(false));
	add(new DateLabel("inserted"));
	add(new DateLabel("updated"));
	add(new Label("errorCount"));
	add(new Label("lastError"));
	add(reset = new AjaxButton("reset") {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onSubmit(AjaxRequestTarget target) {
			getBean(MailMessageDao.class).resetSendingStatus(EmailForm.this.getModelObject().getId());
			target.add(list);
		}
	});
	reset.setEnabled(false);
}
 
Example 6
Project: openmeetings   File: ConfigForm.java   Source Code and License 6 votes vote down vote up
public ConfigForm(String id, WebMarkupContainer listContainer, Configuration configuration) {
	super(id, new CompoundPropertyModel<>(configuration));
	setOutputMarkupId(true);
	this.listContainer = listContainer;
	valueS = new TextField<>("valueS");
	valueN = new TextField<Long>("valueN") {
		private static final long serialVersionUID = 1L;

		@Override
		protected String[] getInputTypes() {
			return new String[] {"number"};
		}
	};
	valueB = new CheckBox("valueB");
	add(new DateLabel("updated"));
	add(new Label("user.login"));
	add(new TextArea<String>("comment"));
	update(null);

	// attach an ajax validation behavior to all form component's keydown
	// event and throttle it down to once per second
	add(new AjaxFormValidatingBehavior("keydown", Duration.ONE_SECOND));
}
 
Example 7
Project: openmeetings   File: LdapForm.java   Source Code and License 6 votes vote down vote up
public LdapForm(String id, WebMarkupContainer listContainer, final LdapConfig ldapConfig) {
	super(id, new CompoundPropertyModel<>(ldapConfig));
	setOutputMarkupId(true);
	this.listContainer = listContainer;

	add(new CheckBox("active"));
	add(new DateLabel("inserted"));
	add(new Label("insertedby.login"));
	add(new DateLabel("updated"));
	add(new Label("updatedby.login"));
	add(new CheckBox("addDomainToUserName"));
	add(new TextField<String>("domain"));
	add(new TextArea<String>("comment"));

	// attach an ajax validation behavior to all form component's keydown
	// event and throttle it down to once per second
	add(new AjaxFormValidatingBehavior("keydown", Duration.ONE_SECOND));
}
 
Example 8
Project: openmeetings   File: InstallWizard.java   Source Code and License 6 votes vote down vote up
public InstallWizard(String id, String title) {
	super(id, title, new CompoundPropertyModel<>(new InstallationConfig()), true);
	setTitle(Model.of(getModelObject().getAppName()));
	welcomeStep = new WelcomeStep();
	dbStep = new DbStep();
	paramsStep1 = new ParamsStep1();
	paramsStep2 = new ParamsStep2();
	paramsStep3 = new ParamsStep3();
	paramsStep4 = new ParamsStep4();
	installStep = new InstallStep();

	DynamicWizardModel wmodel = new DynamicWizardModel(welcomeStep);
	wmodel.setCancelVisible(false);
	wmodel.setLastVisible(true);
	init(wmodel);
}
 
Example 9
Project: directory-fortress-commander   File: RoleDetailPanel.java   Source Code and License 6 votes vote down vote up
public RoleDetailPanel( String id, Displayable display, final boolean isAdmin )
{
    super( id );
    this.isAdmin = isAdmin;
    this.adminMgr.setAdmin( SecUtils.getSession( this ) );
    this.delAdminMgr.setAdmin( SecUtils.getSession( this ) );
    if ( isAdmin )
    {
        this.objName = GlobalIds.DEL_ADMIN_MGR;
        this.editForm = new RoleDetailForm( GlobalIds.EDIT_FIELDS, new CompoundPropertyModel<>(
            new AdminRole() ) );
    }
    else
    {
        this.objName = GlobalIds.ADMIN_MGR;
        this.editForm = new RoleDetailForm( GlobalIds.EDIT_FIELDS, new CompoundPropertyModel<>( new Role() ) );
    }

    this.display = display;
    add( editForm );
}
 
Example 10
Project: webanno   File: TagEditorPanel.java   Source Code and License 6 votes vote down vote up
public TagEditorPanel(String aId, IModel<TagSet> aTagSet, IModel<Tag> aTag)
{
    super(aId, aTag);
    
    setOutputMarkupId(true);
    setOutputMarkupPlaceholderTag(true);
    
    selectedTagSet = aTagSet;
    selectedTag = aTag;
    
    Form<Tag> form = new Form<>("form", CompoundPropertyModel.of(aTag));
    add(form);
    
    form.add(new TextField<String>("name")
            .add(new TagExistsValidator())
            .setRequired(true));
    form.add(new TextArea<String>("description"));
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
    form.add(new LambdaAjaxLink("delete", this::actionDelete)
            .onConfigure(_this -> _this.setVisible(form.getModelObject().getId() != 0)));
    form.add(new LambdaAjaxLink("cancel", this::actionCancel));
}
 
Example 11
Project: webanno   File: TagSetImportPanel.java   Source Code and License 6 votes vote down vote up
public TagSetImportPanel(String aId, IModel<Project> aModel, IModel<TagSet> aTagSet)
{
    super(aId);
    
    setOutputMarkupId(true);
    setOutputMarkupPlaceholderTag(true);
    
    preferences = Model.of(new Preferences());
    selectedProject = aModel;
    selectedTagSet = aTagSet;
    
    Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences));
    form.add(new DropDownChoice<>("format", LambdaModel.of(this::supportedFormats)));
    form.add(new CheckBox("overwrite"));
    form.add(fileUpload = new FileUploadField("content", new ListModel<>()));
    fileUpload.setRequired(true);
    form.add(new LambdaAjaxButton<>("import", this::actionImport));
    add(form);
}
 
Example 12
Project: webanno   File: ConfirmationDialog.java   Source Code and License 6 votes vote down vote up
public ConfirmationDialog(String aId, IModel<String> aTitle, IModel<String> aContent)
{
    super(aId);
    
    titleModel = aTitle;
    contentModel = aContent;
    
    setOutputMarkupId(true);
    setInitialWidth(620);
    setInitialHeight(440);
    setResizable(true);
    setWidthUnit("px");
    setHeightUnit("px");
    setCssClassName("w_blue w_flex");
    showUnloadConfirmation(false);
    
    setModel(new CompoundPropertyModel<>(null));
    
    setContent(contentPanel = new ContentPanel(getContentId(), getModel()));
    
    setCloseButtonCallback((_target) -> {
        onCancelInternal(_target);
        return true;
    });
}
 
Example 13
Project: webanno   File: AnnotationFeatureForm.java   Source Code and License 6 votes vote down vote up
AnnotationFeatureForm(AnnotationDetailEditorPanel aEditorPanel, String id,
    IModel<AnnotatorState> aBModel)
{
    super(id, new CompoundPropertyModel<>(aBModel));
    editorPanel = aEditorPanel;
    add(forwardAnnotationText = createForwardAnnotationTextField());
    add(createForwardAnnotationCheckBox());
    add(createNoAnnotationWarningLabel());
    add(deleteAnnotationDialog = createDeleteDialog());
    add(replaceAnnotationDialog = createReplaceDialog());
    add(createDeleteButton());
    add(createReverseButton());
    add(createClearButton());
    add(relationHint = createRelationHint());
    add(layerSelector = createDefaultAnnotationLayerSelector());
    add(featureEditorPanel = createFeatureEditorPanel());
}
 
Example 14
Project: elpaaso-core   File: ReleaseInformationPanel.java   Source Code and License 6 votes vote down vote up
private void createEditShowInformationComponent(IModel<ApplicationRelease> model) {

        releaseForm = new Form<>("releaseForm");
        releaseForm.setDefaultModel(new CompoundPropertyModel<ApplicationRelease>(model));

        version = new TextField<>("releaseVersion");
        version.setLabel(new StringResourceModel("portal.release.version.label",null));
        version.add(new PropertyValidator<>());
        releaseForm.add(version);

        description = new TextArea<>("description");
        description.setLabel(new StringResourceModel("portal.release.description.label", null));
        description.add(new PropertyValidator<>());
        releaseForm.add(description);

        middlewareProfileVersion = new TextField<>("middlewareProfileVersion");
        middlewareProfileVersion.setLabel(new StringResourceModel("portal.release.middlewareProfileVersion.label", null));
        middlewareProfileVersion.setEnabled(false);
        middlewareProfileVersion.add(new PropertyValidator<>());
        releaseForm.add(middlewareProfileVersion);

        add(releaseForm);
        createButtons();
        manageButtonsVisibility();
        updateEditableInput();
    }
 
Example 15
Project: elpaaso-core   File: ReleaseCreatePanel.java   Source Code and License 6 votes vote down vote up
private void createReleaseForm() {

        ApplicationRelease release = new ApplicationRelease();
        if (app != null) {
            release.setApplication(app);
        }

        releaseForm = new Form<>("releaseForm", new CompoundPropertyModel<ApplicationRelease>(release));

        // if no app is selected then show the drop down
        boolean showSelectedApp = (app == null);
        releaseFieldsetPanel = new ReleaseFieldsetPanel("releaseFieldsetPanel", parentPage, app,
                manageApplication, manageApplicationRelease, showSelectedApp);
        releaseForm.add(releaseFieldsetPanel);

        createFormButtons(releaseForm, releaseFieldsetPanel);

		add(releaseForm);

	}
 
Example 16
Project: elpaaso-core   File: LogicalServiceEditPanel.java   Source Code and License 6 votes vote down vote up
public LogicalServiceBasePanel<LogicalModelItem> getPanel(String id, LogicalModelItem logicalModelItem, Page parentPage,
        boolean isNew, boolean readOnly, boolean configOverride) {

    if (modelItemClass.isInstance(logicalModelItem)) {

        try {
            Constructor<LogicalServiceBasePanel<LogicalModelItem>> panelConstructor = panelClass.getConstructor(String.class, IModel.class, Page.class, boolean.class, boolean.class, boolean.class);
            IModel<LogicalModelItem> model;
            if (isNew) {
                model = new CompoundPropertyModel<>(modelItemClass.newInstance());
            } else {
                model = new CompoundPropertyModel<>(logicalModelItem);
            }
            return panelConstructor.newInstance(id, model, parentPage, isNew, readOnly, configOverride);

        } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            logger.error("Error instantiating panel for logical model item " + modelItemClass.getSimpleName(), e);
            return null;
        }
    } else {
        return null;
    }
}
 
Example 17
Project: artifactory   File: DeployArtifactPanel.java   Source Code and License 6 votes vote down vote up
private DeployArtifactForm(File file) {
    super("form");
    model = new DeployModel();
    model.file = file;
    model.mavenArtifactInfo = guessArtifactInfo();
    model.pomXml = mavenService.getPomModelString(file);
    model.deployPom = (isPomArtifact() || !isPomExists(getPersistentTargetRepo())) && !hasClassifier();
    model.repos = getRepos();
    model.targetRepo = getPersistentTargetRepo();

    setDefaultModel(new CompoundPropertyModel<>(model));

    add(new Label("file.name"));
    addTargetRepoDropDown();
    addPathField();
    addDeployMavenCheckbox();

    WebMarkupContainer artifactInfoContainer = newMavenArtifactContainer();
    add(artifactInfoContainer);

    artifactInfoContainer.add(newPomEditContainer());

    addDefaultButton(new DeployLink("deploy"));
    addButton(new CancelLink("cancel"));
}
 
Example 18
Project: artifactory   File: GeneralConfigPage.java   Source Code and License 6 votes vote down vote up
public GeneralConfigPage() {
    MutableCentralConfigDescriptor descriptor = centralConfigService.getMutableDescriptor();
    setDefaultModel(new CompoundPropertyModel(descriptor));

    Form form = new SecureForm("form", getDefaultModel());
    add(form);

    form.add(new AddonSettingsPanel("addonsSettingsPanel"));
    form.add(new GeneralSettingsPanel("generalConfigPanel"));

    // lnf panel
    lookAndFeelPanel = new CustomizingPanel("customizingPanel", getDefaultModel());
    form.add(lookAndFeelPanel);

    // buttons
    add(new SaveLink("save", form));
    add(new CancelLink("cancel"));
}
 
Example 19
Project: artifactory   File: SecurityGeneralConfigPage.java   Source Code and License 6 votes vote down vote up
public SecurityGeneralConfigPage() {
    TitledBorder generalBorder = new TitledBorder("generalBorder");
    add(generalBorder);

    MutableCentralConfigDescriptor centralConfig = centralConfigService.getMutableDescriptor();
    SecurityDescriptor securityDescriptor = centralConfig.getSecurity();
    CompoundPropertyModel<SecurityDescriptor> securityModel = new CompoundPropertyModel<>(securityDescriptor);
    Form<SecurityDescriptor> form = new SecureForm<>("form", securityModel);
    generalBorder.add(form);

    setOutputMarkupId(true);
    addAnonymousAccessField(form);
    addAnonymousAccessToBuildInfosField(form);
    addHideUnauthorizedResourcesField(form);
    addEncryptionPolicyDropDown(form);
    createButtons(form);
    addEncryptBorder();
    addDecryptBorder();
}
 
Example 20
Project: artifactory   File: HttpRepoPackagesPanel.java   Source Code and License 6 votes vote down vote up
public HttpRepoPackagesPanel(String id, T descriptor, boolean isCreate) {
    super(id);

    Form<T> form = new SecureForm<>("form", new CompoundPropertyModel<>(descriptor));
    add(form);

    addonsManager.addonByType(NuGetWebAddon.class).createAndAddRepoConfigNuGetSection(form, descriptor, isCreate);
    addonsManager.addonByType(P2WebAddon.class).createAndAddRemoteRepoConfigP2Section(form, descriptor);

    form.add(addonsManager.addonByType(GemsWebAddon.class).
            buildPackagesConfigSection("gemsSupportSection", descriptor, form));

    addonsManager.addonByType(NpmWebAddon.class).createAndAddRepoConfigNpmSection(form, descriptor, isCreate);
    addonsManager.addonByType(BowerWebAddon.class).createAndAddRepoConfigBowerSection(form, descriptor, isCreate);
    addonsManager.addonByType(DebianWebAddon.class).createAndAddLocalRepoDebianSection(form, descriptor);
    addonsManager.addonByType(PypiWebAddon.class).createAndAddPypiConfigSection(form, descriptor, isCreate);
    addonsManager.addonByType(DockerWebAddon.class).createAndAddRepoConfigDockerSection(form, descriptor, isCreate);
    addonsManager.addonByType(VcsWebAddon.class).createAndAddVcsConfigSection(form, descriptor, isCreate);
}
 
Example 21
Project: artifactory   File: MaintenancePage.java   Source Code and License 6 votes vote down vote up
private void addGarbageCollectorMaintenance(Form form) {
    final Border gcBorder = new TitledBorder("gcBorder", new CompoundPropertyModel(gcConfigDescriptor));
    form.add(gcBorder);
    TextField<String> cronExpTextField = new TextField<>("cronExp");
    cronExpTextField.setRequired(true);
    cronExpTextField.add(CronExpValidator.getInstance());
    gcBorder.add(cronExpTextField);
    gcBorder.add(new SchemaHelpBubble("cronExp.help"));
    gcBorder.add(new CronNextDatePanel("cronNextDatePanel", cronExpTextField));

    TitledAjaxLink collectLink = new TitledAjaxLink("collect", "Run Now") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            BasicStatusHolder statusHolder = new BasicStatusHolder();
            storageService.callManualGarbageCollect(statusHolder);
            if (statusHolder.isError()) {
                error("Could not run the garbage collector: " + statusHolder.getLastError().getMessage() + ".");
            } else {
                info("Garbage collector was successfully scheduled to run in the background.");
            }
        }
    };
    gcBorder.add(collectLink);
    HelpBubble gcHelpBubble = new HelpBubble("gcHelp", new ResourceModel("garbageHelp"));
    gcBorder.add(gcHelpBubble);
}
 
Example 22
Project: artifactory   File: BintrayArtifactPanel.java   Source Code and License 6 votes vote down vote up
@Override
protected void initBintrayModel() {
    bintrayModel = bintrayService.createParamsFromProperties(pathToPush.getRepoPath());

    if (StringUtils.isBlank(bintrayModel.getPath())) {
        bintrayModel.setPath(pathToPush.getRelPath());
    }

    if (StringUtils.isBlank(bintrayModel.getPackageId())) {
        ModuleInfo moduleInfo = repoService.getItemModuleInfo(pathToPush.getRepoPath());
        if (moduleInfo.isValid()) {
            bintrayModel.setPackageId(moduleInfo.getPrettyModuleId());
            bintrayModel.setVersion(moduleInfo.getBaseRevision());
        }
    }

    setDefaultModel(new CompoundPropertyModel<>(bintrayModel));
}
 
Example 23
Project: sakai   File: PreferencesPage.java   Source Code and License 6 votes vote down vote up
public PreferencesPage(PageParameters pageParameters) {
	realSiteId = Locator.getFacade().getToolManager().getCurrentPlacement().getContext();
	if(pageParameters != null) {
		siteId = pageParameters.get("siteId").toString();
	}
	if(siteId == null){
		siteId = realSiteId;
	}
	boolean allowed = Locator.getFacade().getStatsAuthz().isUserAbleToViewSiteStats(siteId);
	if(allowed) {
		setDefaultModel(new CompoundPropertyModel(this));
		renderBody();
	}else{
		setResponsePage(NotAuthorizedPage.class);
	}
}
 
Example 24
Project: sakai   File: SakaiPagingNavigator.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBeforeRender()
{
	if (get("rowNumberSelector") == null)
	{
		setDefaultModel(new CompoundPropertyModel(this));
		
		// Get the row number selector
		add(newRowNumberSelector(getPageable()));

		// Add additional page links
		replace(newPagingNavigationLink("first", getPageable(), 0));
		replace(newPagingNavigationIncrementLink("prev", getPageable(), -1));
		replace(newPagingNavigationIncrementLink("next", getPageable(), 1));
		replace(newPagingNavigationLink("last", getPageable(), -1));
	}
	super.onBeforeRender();
}
 
Example 25
Project: superfly   File: EditRolePage.java   Source Code and License 6 votes vote down vote up
public EditRolePage(PageParameters parameters) {
    super(ListRolesPage.class, parameters);
     long roleId = parameters.get("id").toLong(-1L);
     final UIRole role  = roleService.getRole(roleId);
     setDefaultModel(new CompoundPropertyModel<UIRole>(role));
     Form form = new Form("form"){

        @Override
        protected void onSubmit() {
        roleService.updateRole(role);
        setResponsePage(ListRolesPage.class);
        }

     };
     add(form);
     form.add(new LabelValueRow<String>("role-name", new Model<String>(role.getRoleName()), "role.create.name"));
     form.add(new LabelTextFieldRow<String>(role, "principalName", "role.create.principal-name", true));
     form.add(new Button("form-submit"));
     form.add(new BookmarkablePageLink<Page>("form-cancel", ListRolesPage.class));
}
 
Example 26
Project: karate   File: HomePanel.java   Source Code and License 5 votes vote down vote up
private void setUpPanel(String id) {
    setDefaultModel(new CompoundPropertyModel(this));
    Form form = new Form("form") {
        @Override
        protected void onSubmit() {
            logger.debug("text is: {}", text);
            KarateSession session = service.createSession("dev", text);
            setResponsePage(new FeaturePage(session.getId()));
        }
    };
    form.add(new TextArea("text"));
    add(form);
    add(new FeedbackPanel("feedback"));
}
 
Example 27
Project: GeoCrawler   File: CrawlsPage.java   Source Code and License 5 votes vote down vote up
public CrawlsPage() {
  crawlsTable = new WebMarkupContainer("crawlsTable");
  crawlsTable.setOutputMarkupId(true);
  crawlsTable.add(new AjaxSelfUpdatingTimerBehavior(UPDATE_TIMEOUT));

  RefreshingView<Crawl> crawls = new RefreshingView<Crawl>("crawls") {

    @Override
    protected Iterator<IModel<Crawl>> getItemModels() {
      return new CpmIteratorAdapter<Crawl>(crawlService.getCrawls());
    }

    @Override
    protected void populateItem(Item<Crawl> item) {
      populateCrawlRow(item);
    }
  };

  crawlsTable.add(crawls);
  add(crawlsTable);

  crawlPanel = new CrawlPanel("crawl");
  add(crawlPanel);

  add(new AjaxLink<Crawl>("newCrawl") {
    @Override
    public void onClick(AjaxRequestTarget target) {
      editCrawl(target, new CompoundPropertyModel<Crawl>(createNewCrawl()));
    }
  });
}
 
Example 28
Project: GeoCrawler   File: SeedPage.java   Source Code and License 5 votes vote down vote up
public void initPage(IModel<SeedList> model) {
  setModel(new CompoundPropertyModel<SeedList>(model));

  addBaseForm();
  addSeedUrlsList();
  addUrlForm();
}
 
Example 29
Project: GeoCrawler   File: InstancesPage.java   Source Code and License 5 votes vote down vote up
private AjaxLink<NutchInstance> addInstanceButton() {
  return new AjaxLink<NutchInstance>("addInstance") {
    @Override
    public void onClick(AjaxRequestTarget target) {
      instancePanel.setModel(new CompoundPropertyModel<NutchInstance>(
          new NutchInstance()));
      target.add(instancePanel);
      instancePanel.appendShowDialogJavaScript(target);
    }
  };
}
 
Example 30
Project: coling2016-marketing-blunders   File: HomePage.java   Source Code and License 5 votes vote down vote up
protected void handleSearch() {
	StatelessForm<Void> form = new StatelessForm<Void>("searchForm"){
		@Override
		protected void onSubmit() {
			PageParameters parameters = new PageParameters();
			parameters.add("search", search);
			setResponsePage(SearchPage.class, parameters);
		}
	};
 	form.add(new TextField<Void>("search"));
 	add(form.setDefaultModel(new CompoundPropertyModel<ApplicationPageBase>(this)));
}
 
Example 31
Project: vlo-curation   File: AllFacetValuesPanel.java   Source Code and License 5 votes vote down vote up
private DataView<FacetField.Count> createValuesView(String id) {
    final IModel<String> fieldNameModel = new PropertyModel<>(getModel(), "name");
    return new DataView<FacetField.Count>(id, valuesProvider, ITEMS_PER_PAGE) {

        @Override
        protected void populateItem(final Item<FacetField.Count> item) {
            item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));

            // link to select an individual facet value
            final Link selectLink = new AjaxFallbackLink("facetSelect") {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    // call callback
                    onValuesSelected(
                            // for now only single values can be selected
                    		Collections.singleton(item.getModelObject().getName()),
                            target);
                }
            };
            item.add(selectLink);

            // 'name' field from Count (name of value)
            selectLink.add(new FieldValueLabel("name", fieldNameModel));

            // 'count' field from Count (document count for value)
            item.add(new Label("count"));
        }
    };
}
 
Example 32
Project: vlo-curation   File: ResourceLinkDetailsPanel.java   Source Code and License 5 votes vote down vote up
public ResourceLinkDetailsPanel(String id, IModel<ResourceInfo> model) {
    super(id, model);
    setDefaultModel(new CompoundPropertyModel<>(model));
    // get the friendly name of the resource type dynamically from the resource bundle
    add(new Label("resourceType", StringResourceModelMigration.of("resourcetype.${resourceType}.singular", model, model.getObject().getResourceType())));
    add(new Label("fileName"));
    add(new Label("mimeType"));
    add(new Label("href"));
}
 
Example 33
Project: directory-fortress-commander   File: AuditModDetailPanel.java   Source Code and License 5 votes vote down vote up
public AuditModDetailPanel( String id, Displayable display )
{
    super( id );
    this.auditMgr.setAdmin( SecUtils.getSession( this ) );
    this.reviewMgr.setAdmin( SecUtils.getSession( this ) );
    this.detailForm = new AuditAuthzDetailForm( GlobalIds.DETAIL_FIELDS, new CompoundPropertyModel<>( new Mod() ) );
    this.display = display;
    add( detailForm );
}
 
Example 34
Project: oldSyncopeIdM   File: RoleSummaryPanel.java   Source Code and License 5 votes vote down vote up
public RoleSummaryPanel(final String id,
        final ModalWindow window, final PageReference callerPageRef) {

    super(id);

    this.callerPageRef = callerPageRef;
    this.window = window;

    fragment = new Fragment("rolePanel",
            this.selectedNode == null
            ? "fakerootFrag" : (this.selectedNode.getId() != 0
            ? "roleViewPanel" : "rootPanel"), this);

    if (this.selectedNode != null) {
        if (this.selectedNode.getId() != 0) {
            roleTabPanel =
                    new RoleTabPanel("nodeViewPanel",
                    selectedNode, window, callerPageRef);
            roleTabPanel.setOutputMarkupId(true);
            fragment.add(roleTabPanel);
        } else {
            actionLink =
                    new TreeActionLinkPanel("actionLink",
                    this.selectedNode.getId(),
                    new CompoundPropertyModel(this.selectedNode),
                    window, callerPageRef);
            fragment.add(actionLink);
        }
    }

    add(fragment);
}
 
Example 35
Project: oldSyncopeIdM   File: RoleSummaryPanel.java   Source Code and License 5 votes vote down vote up
@Override
public void onEvent(final IEvent<?> event) {
    super.onEvent(event);

    if (event.getPayload() instanceof TreeNodeClickUpdate) {

        final TreeNodeClickUpdate update =
                (TreeNodeClickUpdate) event.getPayload();

        this.selectedNode =
                restClient.readRole(update.getSelectedNodeId());

        fragment = new Fragment("rolePanel", (update.getSelectedNodeId()
                != 0
                ? "roleViewPanel" : "rootPanel"), this);

        if (update.getSelectedNodeId() != 0) {

            roleTabPanel =
                    new RoleTabPanel("nodeViewPanel",
                    this.selectedNode, window, callerPageRef);
            roleTabPanel.setOutputMarkupId(true);
            fragment.addOrReplace(roleTabPanel);
        } else {
            actionLink =
                    new TreeActionLinkPanel("actionLink",
                    update.getSelectedNodeId(),
                    new CompoundPropertyModel(this.selectedNode),
                    window, callerPageRef);
            actionLink.setOutputMarkupId(true);
            fragment.addOrReplace(actionLink);
        }

        replace(fragment);
        update.getTarget().add(this);
    }
}
 
Example 36
Project: directory-fortress-commander   File: PwPolicyDetailPanel.java   Source Code and License 5 votes vote down vote up
public PwPolicyDetailPanel( String id, Displayable display )
{
    super( id );
    this.pwPolicyMgr.setAdmin( SecUtils.getSession( this ) );
    this.editForm = new PwPolicyDetailForm( GlobalIds.EDIT_FIELDS, new CompoundPropertyModel<>(
        new PwPolicy() ) );
    this.display = display;
    add( editForm );
}
 
Example 37
Project: openmeetings   File: UserForm.java   Source Code and License 5 votes vote down vote up
public UserForm(String id, WebMarkupContainer listContainer, final User user, MessageDialog warning) {
	super(id, new CompoundPropertyModel<>(user));
	setOutputMarkupId(true);
	this.listContainer = listContainer;
	this.warning = warning;
	add(generalForm = new GeneralUserForm("general", getModel(), true));
}
 
Example 38
Project: ontopia   File: SignInPage.java   Source Code and License 5 votes vote down vote up
public SignInForm(String id) { 
  super(id); 
  setDefaultModel(new CompoundPropertyModel<SignInForm>(this)); 
  
  add(new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(this)));
  
  add(new TextField<String>("username")); 
  add(new PasswordTextField("password"));   
}
 
Example 39
Project: openmeetings   File: LabelsForm.java   Source Code and License 5 votes vote down vote up
public LabelsForm(String id, LangPanel panel, StringLabel label) {
	super(id, new CompoundPropertyModel<>(label));
	this.panel = panel;
	key = label.getKey();
	value = label.getValue();

	add(new RequiredTextField<String>("key"));
	add(new TextArea<String>("value"));
}
 
Example 40
Project: openmeetings   File: AppointmentDialog.java   Source Code and License 5 votes vote down vote up
public AppointmentDialog(String id, CalendarPanel calendarPanel, CompoundPropertyModel<Appointment> model) {
	super(id, "", model, true);
	log.debug(" -- AppointmentDialog -- Current model " + getModel().getObject());
	this.calendarPanel = calendarPanel;
	setOutputMarkupId(true);
	form = new AppointmentForm("appForm", model);
	add(form);
}