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

The following examples show how to use org.apache.wicket.model.ResourceModel. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: inception   Source File: SubclassCreationDialog.java    License: Apache License 2.0 6 votes vote down vote up
public ContentPanel(String aId, IModel<KBConcept> newSubclassConceptModel)
{
    super(aId);

    // add components for input form
    RequiredTextField<String> name = new RequiredTextField<>("name");
    name.add(AttributeModifier.append("placeholder",
            new ResourceModel("subclassNamePlaceholder")));

    LambdaAjaxButton<KBConcept> createButton = new LambdaAjaxButton<KBConcept>(
            "createSubclass", SubclassCreationDialog.this::actionCreateSubclass);
    createButton.add(new Label("createLabel", new ResourceModel("create")));

    // initialize input form and add it to the content panel
    Form<KBConcept> form = new Form<KBConcept>("form",
            CompoundPropertyModel.of(newSubclassConceptModel));
    form.add(name);
    form.add(createButton);
    form.setDefaultButton(createButton);
    add(form);
}
 
Example 2
Source Project: sakai   Source File: MyPictures.java    License: Educational Community License v2.0 6 votes vote down vote up
private void createGalleryForm(final String userUuid, long pageToDisplay) {

		Label galleryHeading = new Label("galleryHeading", new ResourceModel(
				"heading.pictures.my.pictures"));
		add(galleryHeading);

		Form galleryForm = new Form("galleryForm");
		galleryForm.setOutputMarkupId(true);

		populateGallery(galleryForm, userUuid, pageToDisplay);
		add(galleryForm);

		Label addPictureHeading = new Label("addPictureHeading",
				new ResourceModel("heading.pictures.addpicture"));
		add(addPictureHeading);
	}
 
Example 3
public AssociationTransformFunctionBoxPanel(String id, final TopicModel<Topic> topicModel) {
  super(id);
  add(new Label("title", new ResourceModel("transform.association.instances")));   
  
  Button addButton = new Button("button", new ResourceModel("transform"));
  addButton.add(new AjaxFormComponentUpdatingBehavior("onclick") {
    @Override
    protected void onUpdate(AjaxRequestTarget target) {
      Topic instance = topicModel.getTopic();
      Map<String,String> pageParametersMap = new HashMap<String,String>();
      pageParametersMap.put("topicMapId", instance.getTopicMap().getId());
      pageParametersMap.put("topicId", instance.getId());
      setResponsePage(AssociationTransformPage.class, new PageParameters(pageParametersMap));
    }          
  });
  add(addButton);
}
 
Example 4
Source Project: sakai   Source File: SakaiNavigatorLabel.java    License: Educational Community License v2.0 6 votes vote down vote up
private SakaiNavigatorLabel(final String id, final PageableComponent table) {
	super(id);
	Model model = new Model(new LabelModelObject(table)); 
	setDefaultModel(
			new StringResourceModel(
					"pager_textStatus", 
					this, 
					model,
					"Viewing {0} - {1} of {2} {3}",
					new Object[] {
						new PropertyModel(model, "from"),
						new PropertyModel(model, "to"),
						new PropertyModel(model, "of"),
						new ResourceModel("pager_textItem"),
					})
	);
}
 
Example 5
Source Project: openmeetings   Source File: SignInDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitialize() {
	add(form = new SignInForm("signin"));
	header(new ResourceModel("108"));
	show(true);
	setCloseOnEscapeKey(false);
	setBackdrop(Backdrop.STATIC);
	addButton(new SpinnerAjaxButton("button", new ResourceModel("112"), form, Buttons.Type.Outline_Primary)); // Login
	addButton(new BootstrapAjaxLink<>("button", Model.of(""), Buttons.Type.Outline_Secondary, new ResourceModel("123")) {
		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			SignInDialog.this.close(target);
			register.setClientTimeZone();
			register.show(target);
		}
	}.setVisible(OpenmeetingsVariables.isAllowRegisterFrontend()));

	super.onInitialize();
}
 
Example 6
Source Project: openmeetings   Source File: StartWidgetView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitialize() {
	add(new WebMarkupContainer("step1").add(new PublicRoomsEventBehavior()));
	add(new WebMarkupContainer("step2").add(new PublicRoomsEventBehavior()));
	add(new WebMarkupContainer("step3").add(new WebMarkupContainer("avTest").add(AttributeModifier.append("href"
			, RequestCycle.get().urlFor(HashPage.class, new PageParameters().add(APP, APP_TYPE_SETTINGS)).toString()))));

	add(new WebMarkupContainer("step4").add(new PublicRoomsEventBehavior()));
	add(new Label("123msg", Application.getString("widget.start.desc")) //Application here is used to substitute {0}
			.setEscapeModelStrings(false));
	add(new BootstrapButton("start", new ResourceModel("788"), Buttons.Type.Outline_Primary).add(new PublicRoomsEventBehavior()));
	add(new BootstrapButton("calendar", new ResourceModel("291"), Buttons.Type.Outline_Primary).add(new AjaxEventBehavior(EVT_CLICK) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onEvent(AjaxRequestTarget target) {
			((MainPage)getPage()).updateContents(CALENDAR, target);
		}
	}));
	super.onInitialize();
}
 
Example 7
Source Project: openmeetings   Source File: EventDetailDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitialize() {
	header(new ResourceModel("815"));
	setCloseOnEscapeKey(false);
	setBackdrop(Backdrop.FALSE);
	size(Size.Small);
	show(true);

	super.onInitialize();
	add(new Label("title"));
	add(new Label("description").setEscapeModelStrings(false));
	add(new Label("owner.timeZoneId"));
	add(new Label("start", getDateFormat().format(getModelObject().getStart())));
	add(new Label("end", getDateFormat().format(getModelObject().getEnd())));
	add(new Label("owner.firstname"));
	add(new Label("owner.lastname"));
	addButton(OmModalCloseButton.of());
}
 
Example 8
Source Project: ontopia   Source File: VizigatorLinkFunctionBoxPanel.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected Component getLink(String id) {
  PageParameters pageParameters = new PageParameters();
  pageParameters.put("topicMapId", getTopicMapId());
  pageParameters.put("topicId", getTopicId());
  
  return new BookmarkablePageLink<Page>(id, VizigatorPage.class, pageParameters) {
    @Override
    protected void onComponentTag(ComponentTag tag) {
      tag.setName("a");
      //tag.put("target", "_blank");
      super.onComponentTag(tag);
    }
    @Override
    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
      replaceComponentTagBody(markupStream, openTag, new ResourceModel("vizigator.text2").getObject().toString());
    }
  };
}
 
Example 9
Source Project: openmeetings   Source File: ConvertingErrorsDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Modal<BaseFileItem> show(IPartialPageRequestHandler handler) {
	BaseFileItem f = getModelObject();
	headerLabel.setDefaultModel(new ResourceModel(f.getType() == BaseFileItem.Type.RECORDING ? "887" : "convert.errors.file"));

	List<FileItemLog> logs = fileLogDao.get(f);
	if (f.getHash() == null) {
		message.setVisible(true);
		message.setDefaultModelObject(getString("888"));
	} else if (!f.exists()) {
		message.setVisible(true);
		message.setDefaultModelObject(getString(f.getType() == BaseFileItem.Type.RECORDING ? "1595" : "convert.errors.file.missing"));
	} else {
		message.setVisible(false);
	}
	if (!logs.isEmpty()) {
		logView.setVisible(false);
		logView.setList(logs).setVisible(true);
	}
	handler.add(container, headerLabel);
	return super.show(handler);
}
 
Example 10
Source Project: openmeetings   Source File: FileTreePanel.java    License: Apache License 2.0 6 votes vote down vote up
private ConfirmableAjaxBorder getTrashBorder() {
	if (trashBorder == null) {
		trashBorder = new ConfirmableAjaxBorder("trash", new ResourceModel("80"), new ResourceModel("713")) {
			private static final long serialVersionUID = 1L;

			@Override
			protected boolean isClickable() {
				return !readOnly && !selected.isEmpty();
			}

			@Override
			protected void onConfirm(AjaxRequestTarget target) {
				deleteAll(target);
			}
		};
	}
	return trashBorder;
}
 
Example 11
@SuppressWarnings("unchecked")
@Override
public void onInitialize() {
	super.onInitialize();

	final String siteId = ((Model<String>) getDefaultModel()).getObject();

	StudentCourseGradeStatisticsPanel.this.window.setTitle(new ResourceModel("label.statistics.title.coursegrade"));

	final CourseGradeChart chart = new CourseGradeChart("chart", siteId, studentGrade);
	add(chart);

	add(new GbAjaxLink<Void>("done") {
		private static final long serialVersionUID = 1L;

		@Override
		public void onClick(final AjaxRequestTarget target) {
			StudentCourseGradeStatisticsPanel.this.window.close(target);
		}
	});
}
 
Example 12
Source Project: sakai   Source File: GalleryImageEdit.java    License: Educational Community License v2.0 6 votes vote down vote up
private AjaxFallbackButton createRemoveCancelButton(Form imageEditForm) {
	AjaxFallbackButton removeCancelButton = new AjaxFallbackButton(
			"galleryRemoveImageCancelButton", new ResourceModel(
					"button.cancel"), imageEditForm) {

		@Override
		protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
			target.appendJavaScript("$('#"
					+ removeConfirmContainer.getMarkupId() + "').hide();");

			imageOptionsContainer.setVisible(true);
			target.add(imageOptionsContainer);

			target.appendJavaScript("setMainFrameHeight(window.name);");
		}

	};
	return removeCancelButton;
}
 
Example 13
Source Project: sakai   Source File: GalleryImageEdit.java    License: Educational Community License v2.0 6 votes vote down vote up
private AjaxFallbackButton createRemovePictureButton(Form imageEditForm) {
	AjaxFallbackButton removePictureButton = new AjaxFallbackButton(
			"galleryImageRemoveButton", new ResourceModel(
					"button.gallery.remove"), imageEditForm) {

		@Override
		protected void onSubmit(AjaxRequestTarget target, Form form) {

			imageOptionsContainer.setVisible(false);

			target.appendJavaScript("$('#"
					+ imageOptionsContainer.getMarkupId() + "').hide();");

			removeConfirmContainer.setVisible(true);
			target.add(removeConfirmContainer);
			target.appendJavaScript("setMainFrameHeight(window.name);");
		}

	};
	return removePictureButton;
}
 
Example 14
Source Project: sakai   Source File: GalleryImageEdit.java    License: Educational Community License v2.0 6 votes vote down vote up
private AjaxFallbackButton createSetProfileImageCancelButton(Form imageEditForm) {
	AjaxFallbackButton removeCancelButton = new AjaxFallbackButton(
			"gallerySetProfileImageCancelButton", new ResourceModel(
					"button.cancel"), imageEditForm) {

		@Override
		protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
			target.appendJavaScript("$('#"
					+ setProfileImageConfirmContainer.getMarkupId() + "').hide();");

			imageOptionsContainer.setVisible(true);
			target.add(imageOptionsContainer);

			target.appendJavaScript("setMainFrameHeight(window.name);");
		}

	};
	return removeCancelButton;
}
 
Example 15
Source Project: ontopia   Source File: SignInPage.java    License: Apache License 2.0 6 votes vote down vote up
public SignInPage(PageParameters params) {
super(params);
    
add(new StartPageHeaderPanel("header"));
add(new FooterPanel("footer"));

   add(new Label("title", new ResourceModel("page.title.signin")));

   add(new Label("message", new AbstractReadOnlyModel<String>() {
       @Override
       public String getObject() {
         OntopolySession session = (OntopolySession)Session.findOrCreate();
         return session.getSignInMessage();
       }
     }));
   add(new SignInForm("form"));
 }
 
Example 16
Source Project: inception   Source File: AccessSpecificSettingsPanel.java    License: Apache License 2.0 5 votes vote down vote up
private void setUpLocalSpecificSettings(WebMarkupContainer wmc)
{
    wmc.add(uploadForm("uploadForm", "uploadField"));

    // add link for clearing the knowledge base contents, enabled only, if there is
    // something to clear
    AjaxLink<Void> clearLink = clearLink("clear");
    wmc.add(clearLink);

    wmc.add(fileExtensionsExportList("exportButtons"));

    List<KnowledgeBaseProfile> localKBs = knowledgeBaseProfiles.values().stream()
        .filter(kb -> RepositoryType.LOCAL.equals(kb.getType()))
        .collect(Collectors.toList());

    listViewContainer = new WebMarkupContainer("listViewContainer");
    ListView<KnowledgeBaseProfile> suggestions = localSuggestionsList("localKBs", localKBs);
    listViewContainer.add(suggestions);
    listViewContainer.setOutputMarkupPlaceholderTag(true);

    LambdaAjaxLink addKbButton = new LambdaAjaxLink("addKbButton",
        this::actionDownloadKbAndSetIRIs);
    addKbButton.add(new Label("addKbLabel", new ResourceModel("kb.wizard.steps.local.addKb")));
    listViewContainer.add(addKbButton);

    infoContainerLocal = createKbInfoContainer("infoContainer");
    infoContainerLocal.setOutputMarkupId(true);
    wmc.add(infoContainerLocal);

    wmc.add(listViewContainer);
}
 
Example 17
Source Project: ontopia   Source File: OmnigatorLinkFunctionBoxPanel.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Component getLink(String id) {
  String url = new ResourceModel("omnigator.url").getObject().toString()+"?tm="+getTopicMapId()+"&id="+getTopicId();
  
  return new ExternalLink(id, url, new ResourceModel("omnigator.link.label").getObject().toString()) {
    @Override
    protected void onComponentTag(ComponentTag tag) {
      tag.setName("a");
      tag.put("target", "_blank");
      super.onComponentTag(tag);
    }
  };
}
 
Example 18
Source Project: inception   Source File: AbstractInfoPanel.java    License: Apache License 2.0 5 votes vote down vote up
public EditMode(String id, CompoundPropertyModel<T> compoundModel) {
    super(id, "editMode", AbstractInfoPanel.this);
    
    // set up form components
    TextField<String> name = new TextField<>("name", compoundModel.bind("name"));
    name.add(AttributeModifier.append("placeholder",
            new ResourceModel(getNamePlaceholderResourceKey())));
    name.setOutputMarkupId(true);
    focusComponent = name;

    // there exists functionality to cancel the "new KBObject" prompt, but in hindsight, MB
    // thinks this functionality is not really needed in the UI, so the button is hidden
    // here
    LambdaAjaxLink cancelButton = new LambdaAjaxLink("cancel",
            AbstractInfoPanel.this::actionCancel)
                    .onConfigure((_this) -> _this.setVisible(false));
    cancelButton.add(new Label("label", new ResourceModel(getCancelButtonResourceKey())));

    LambdaAjaxButton<T> createButton = new LambdaAjaxButton<>("create",
            AbstractInfoPanel.this::actionCreate);
    createButton.add(new Label("label", new ResourceModel(getCreateButtonResourceKey())));

    Form<T> form = new Form<T>("form", compoundModel);
    form.add(name);
    form.add(cancelButton);
    form.add(createButton);
    form.setDefaultButton(createButton);
    add(form);
}
 
Example 19
Source Project: inception   Source File: ConceptListPanel.java    License: Apache License 2.0 5 votes vote down vote up
public ConceptListPanel(String aId, IModel<KnowledgeBase> aKbModel,
        IModel<KBHandle> selectedConceptModel) {
    super(aId, selectedConceptModel);

    setOutputMarkupId(true);

    selectedConcept = selectedConceptModel;
    kbModel = aKbModel;
    preferences = Model.of(new Preferences());

    OverviewListChoice<KBHandle> overviewList = new OverviewListChoice<>("concepts");
    overviewList.setChoiceRenderer(new ChoiceRenderer<>("uiLabel"));
    overviewList.setModel(selectedConceptModel);
    overviewList.setChoices(LambdaModel.of(this::getConcepts));
    overviewList.add(new LambdaAjaxFormComponentUpdatingBehavior("change",
            this::actionSelectionChanged));
    overviewList.setMaxRows(LIST_MAX_ROWS);
    add(overviewList);

    add(new Label("count", LambdaModel.of(() -> overviewList.getChoices().size())));

    LambdaAjaxLink addLink = new LambdaAjaxLink("add", target -> send(getPage(),
            Broadcast.BREADTH, new AjaxNewConceptEvent(target)));
    addLink.add(new Label("label", new ResourceModel("concept.list.add")));
    addLink.add(new WriteProtectionBehavior(kbModel));
    add(addLink);

    Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences));
    form.add(new CheckBox("showAllConcepts").add(
            new LambdaAjaxFormSubmittingBehavior("change", this::actionPreferenceChanged)));
    add(form);
}
 
Example 20
Source Project: inception   Source File: PropertyListPanel.java    License: Apache License 2.0 5 votes vote down vote up
public PropertyListPanel(String aId, IModel<KnowledgeBase> aKbModel, IModel<KBProperty> aModel)
{
    super(aId, aModel);

    setOutputMarkupId(true);

    selectedProperty = aModel;
    kbModel = aKbModel;
    preferences = Model.of(new Preferences());

    OverviewListChoice<KBProperty> overviewList = new OverviewListChoice<>("properties");
    overviewList.setChoiceRenderer(new ChoiceRenderer<>("uiLabel"));
    overviewList.setModel(selectedProperty);
    overviewList.setChoices(LambdaModel.of(this::getProperties));
    overviewList.add(new LambdaAjaxFormComponentUpdatingBehavior("change",
            this::actionSelectionChanged));
    
    add(overviewList);

    add(new Label("count", LambdaModel.of(() -> overviewList.getChoices().size())));

    LambdaAjaxLink addLink = new LambdaAjaxLink("add",
        target -> send(getPage(), Broadcast.BREADTH, new AjaxNewPropertyEvent(target)));
    addLink.add(new Label("label", new ResourceModel("property.list.add")));
    addLink.add(new WriteProtectionBehavior(kbModel));
    add(addLink);

    Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences));
    form.add(new CheckBox("showAllProperties").add(
            new LambdaAjaxFormSubmittingBehavior("change", this::actionPreferenceChanged)));
    add(form);
}
 
Example 21
private void setISODates() {
	final String dueDateString = StringUtils.trimToNull(
			getRequest().getRequestParameters().getParameterValue(HIDDEN_DUEDATE_ISO8601).toString(""));
	//Allow for clearing the due date

	if (dueDateString == null) {
		this.dueDate = null;
	}
	else if (DateFormatterUtil.isValidISODate(dueDateString)) {
		this.dueDate = DateFormatterUtil.parseISODate(dueDateString);
	}
	else {
		error(new ResourceModel("error.addgradeitem.duedate").getObject());
	}
}
 
Example 22
Source Project: inception   Source File: ProjectsOverviewPage.java    License: Apache License 2.0 5 votes vote down vote up
public ProjectsOverviewPage()
{
    add(projectListContainer = createProjectList());
    add(createNewProjectLink());
    add(createStartTutorialLink());
    add(createImportProjectForm());
    add(roleFilters = createRoleFilters());
    add(confirmLeaveDialog = new ConfirmationDialog(MID_CONFIRM_LEAVE,
            new StringResourceModel("leaveDialog.title", this),
            new StringResourceModel("leaveDialog.text", this)));
    activeRoleFilters = Model.ofSet(new HashSet<>());
    
    emptyListLabel = new Label(MID_EMPTY_LIST_LABEL, new ResourceModel("noProjects"));
    projectListContainer.add(emptyListLabel);
}
 
Example 23
Source Project: the-app   Source File: HomePage.java    License: Apache License 2.0 5 votes vote down vote up
private Component youMayAlsoLikeProductsPanel() {
    return new RecommendationItemListPanel("youMayAlsoLikeProductsContainer", feedback, "MAY_ALSO_LIKE", new ResourceModel("you.may.also.like.topic"),
            new LoadableDetachableModel<List<ProductInfo>>() {
                @Override
                protected List<ProductInfo> load() {
                    return recommendationService.getCollaborativeFilteringRecommendations(4);
                }
            }) {
    };
}
 
Example 24
Source Project: openmeetings   Source File: EmailForm.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	add(status);
	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 BootstrapAjaxButton("reset", new ResourceModel("admin.email.reset.status"), Buttons.Type.Outline_Primary) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onSubmit(AjaxRequestTarget target) {
			emailDao.resetSendingStatus(EmailForm.this.getModelObject().getId());
			target.add(list);
		}
	});
	reset.setEnabled(false);
	// add a cancel button that can be used to submit the form via ajax
	delBtn = new AjaxLink<>("btn-delete") {
		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			emailDao.delete(EmailForm.this.getModelObject().getId());
			EmailForm.this.setModelObject(new MailMessage());
			target.add(list, EmailForm.this);
		}
	};
	delBtn.add(newOkCancelDangerConfirm(this, getString("833")));
	add(delBtn.setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true).setVisible(false));
}
 
Example 25
Source Project: openmeetings   Source File: AccessDeniedPage.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	add(new Form<Void>("form").add(
			new BootstrapButton("home", new ResourceModel("124"), Buttons.Type.Outline_Primary) {
				private static final long serialVersionUID = 1L;

				@Override
				public void onSubmit() {
					setResponsePage(Application.get().getHomePage());
				}
			}
			, new BootstrapButton("logout", new ResourceModel("310"), Buttons.Type.Outline_Danger) {
				private static final long serialVersionUID = 1L;

				@Override
				public boolean isVisible() {
					return WebSession.get().isSignedIn();
				}

				@Override
				public void onSubmit() {
					getSession().invalidate();
					setResponsePage(Application.get().getSignInPageClass());
				}
			})
		);
}
 
Example 26
Source Project: openmeetings   Source File: RegisterDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize() {
	header(new ResourceModel("113"));
	setUseCloseHandler(true);

	addButton(new SpinnerAjaxButton("button", new ResourceModel("121"), form, Buttons.Type.Outline_Primary)); // register
	addButton(OmModalCloseButton.of());
	add(form);
	add(new Label("register", getString("121")).setRenderBodyOnly(true), new BookmarkablePageLink<>("link", PrivacyPage.class));
	reset(null);
	super.onInitialize();
}
 
Example 27
Source Project: sakai   Source File: AdminMenu.java    License: Educational Community License v2.0 5 votes vote down vote up
/**
 * Render Sakai Menu
 */
@SuppressWarnings("unchecked")
private void renderBody() {
	// site id
	String siteId = Locator.getFacade().getToolManager().getCurrentPlacement().getContext();
	PageParameters pageParameters = new PageParameters().set("siteId", siteId);
			
	// --------- ADMIN SECTION ---------
	
	// Admin page
	boolean adminPageVisible = 
		Locator.getFacade().getStatsAuthz().isUserAbleToViewSiteStatsAdmin(siteId);
	MenuItem adminPage = new MenuItem("adminPage", new ResourceModel("menu_sitelist"), AdminPage.class, pageParameters, true, null);
	adminPage.setVisible(adminPageVisible);
	add(adminPage);
	
	// Admin reports
	boolean reportsPageVisible = 
		Locator.getFacade().getStatsAuthz().isUserAbleToViewSiteStatsAdmin(siteId);
	MenuItem reportsPage = new MenuItem("reportsPage", new ResourceModel("menu_adminreports"), AdminReportsPage.class, pageParameters, false, null);
	reportsPage.setVisible(reportsPageVisible);
	add(reportsPage);
	
	// Admin ServerWide page
	boolean serverWidePageVisible = 
		Locator.getFacade().getStatsManager().isServerWideStatsEnabled();
	MenuItem serverWidePage = new MenuItem("serverWidePage", new ResourceModel("menu_serverwide"), ServerWidePage.class, pageParameters, false, null);
	serverWidePage.setVisible(serverWidePageVisible);
	add(serverWidePage);		
}
 
Example 28
Source Project: openmeetings   Source File: ForgetPasswordDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize() {
	header(new ResourceModel("312"));
	setUseCloseHandler(true);

	addButton(new BootstrapAjaxButton("button", new ResourceModel("317"), form, Buttons.Type.Outline_Primary) {
		private static final long serialVersionUID = 1L;
	}); // Send
	addButton(OmModalCloseButton.of());

	add(form);
	super.onInitialize();
}
 
Example 29
Source Project: ontopia   Source File: LinkFunctionBoxPanel.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected List<List<Component>> getFunctionBoxComponentList(String id) {
  List<Component> heading = Arrays.asList(new Component[] { getLabel(id) }); 
  List<Component> box = Arrays.asList(new Component[] {
      new Label(id, new ResourceModel("arrow.right")), getLink(id) });
  
  List<List<Component>> result = new ArrayList<List<Component>>(2);
  result.add(heading);
  result.add(box);
  return result;
}
 
Example 30
Source Project: openmeetings   Source File: InstallWizard.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	add(tzDropDown);
	add(new RequiredTextField<String>("username").setLabel(new ResourceModel("install.wizard.params.step1.username")).add(minimumLength(USER_LOGIN_MINIMUM_LENGTH)));
	add(new PasswordTextField("password")
			.setResetPassword(false).setLabel(new ResourceModel("install.wizard.params.step1.password"))
			.add(new StrongPasswordValidator(new User())));
	add(new RequiredTextField<String>("email").setLabel(new ResourceModel("lbl.email")).add(RfcCompliantEmailAddressValidator.getInstance()));
	add(new RequiredTextField<String>("group").setLabel(new ResourceModel("install.wizard.params.step1.group")));
}