Package org.apache.wicket.model

Examples of org.apache.wicket.model.ResourceModel


    protected Label createPageTitleTag(String resourceKey) {
        return new Label("pageTitle", new ResourceModel(resourceKey));
    }

    protected Label createPageHeading(String resourceKey) {
        return new Label("pageHeading", new ResourceModel(resourceKey));
    }
View Full Code Here


    protected Label createPageHeading(String resourceKey) {
        return new Label("pageHeading", new ResourceModel(resourceKey));
    }

    protected Label createPageMessage(String resourceKey) {
        return new Label("pageMessage", new ResourceModel(resourceKey));
    }
View Full Code Here

        add(createActiveUsersTable());
    }

    private BootstrapBookmarkablePageLink<String> createDoneButton() {
        return new BootstrapBookmarkablePageLink<String>("doneButton", Home.class, Buttons.Type.Primary)
                .setLabel(new ResourceModel("button.done"))
                .setIconType(GlyphIconType.ok);
    }
View Full Code Here

        userListColumns.add(createColumn("activeUsers.fullName", "fullName", "fullName"));
        return userListColumns;
    }

    private PropertyColumn<User, String> createColumn(String key, String sortProperty, String propertyExpression) {
        return new PropertyColumn<User, String>(new ResourceModel(key), sortProperty, propertyExpression);
    }
View Full Code Here

    protected void onInitialize() {
        super.onInitialize();

        StartupListener.setupContext(getServletContext());
       
        getSession().info(createDefaultInfoNotificationMessage(new ResourceModel("reload.succeeded")));
        throw new RestartResponseException(getApplication().getHomePage());
    }
View Full Code Here

    @Override
    protected void onSaveButtonSubmit() {
        User user = prepareNewUser();
        user = saveUser(user);
        prepareAndSendNewUserEmail(user);
        getSession().info(createDefaultInfoNotificationMessage(new ResourceModel("user.registered")));
        setUserNameCookieAndSetResponsePage(user.getUsername());
    }
View Full Code Here

    private void sendMessage(SimpleMailMessage message) {
        try {
            mailEngine.send(message);
        } catch (MailException me) {
            log.error(me.getMostSpecificCause().getMessage(), me);
            getSession().warn(new NotificationMessage(new ResourceModel("errors.sending.email")));
        }
    }
View Full Code Here

        public InformationTab(String id, JetspeedDocument document)
        {
            super(id, document);
            Form infoForm = new Form("infoForm");
            Label nameLabel = new Label("name",
                    new ResourceModel("common.name"));
            TextField nameField = new TextField("nameField", new PropertyModel(
                    this, "document.name"));
            infoForm.add(nameLabel);
            infoForm.add(nameField);
            Label titleLabel = new Label("title", new ResourceModel("Title"));
            TextField titleField = new TextField("titleField",
                    new PropertyModel(this, "document.title"));
            infoForm.add(titleLabel);
            infoForm.add(titleField);
            Label shortTitleLabel = new Label("shortTitle", new ResourceModel(
                    "ShortTitle"));
            TextField shortTitleField = new TextField("shortTitleField",
                    new PropertyModel(this, "document.shortTitle"));
            infoForm.add(shortTitleField);
            infoForm.add(shortTitleLabel);
            Label pageDecoratorLabel = new Label("pageDecorator",
                    "Page Decorator");
            DropDownChoice decoratorsList = new DropDownChoice(
                    "decoratorsList", new PropertyModel(this,
                            "document.pageDecorator"), getPageDecorators());
            infoForm.add(decoratorsList);
            infoForm.add(pageDecoratorLabel);
            Label portletDecoratorLabel = new Label("portletDecorator",
                    "Portlet Decorator");
            DropDownChoice portletDecoratorsList = new DropDownChoice(
                    "portletDecoratorsList", new PropertyModel(this,
                            "document.portletDecorator"),
                    getPortletDecorators());
            infoForm.add(portletDecoratorLabel);
            infoForm.add(portletDecoratorsList);
            Label themeLabel = new Label("theme", "Theme");
            DropDownChoice themeField = new DropDownChoice("themeList",
                    new PropertyModel(this, "document.desktopTheme"),
                    getThemes());
            themeField.setVisibilityAllowed(true);
            themeLabel.setVisibilityAllowed(true);
            infoForm.add(themeField);
            infoForm.add(themeLabel);
            Label visibleLabel = new Label("visible", new ResourceModel(
                    "Hidden"));
            CheckBox visibleCheckbox = new CheckBox("visibleCheck",
                    new PropertyModel(this, "document.hidden"));
            infoForm.add(visibleLabel);
            infoForm.add(visibleCheckbox);
            Label urlLabel = new Label("urlLabel", new ResourceModel("Url"));
            TextField urlField = new TextField("urlField", new PropertyModel(
                    this, "document.url"));
            infoForm.add(urlLabel);
            infoForm.add(urlField);
            urlLabel.setVisibilityAllowed(true);
            urlField.setVisibilityAllowed(true);
            Label targetLabel = new Label("targetLabel", "Target Window");
            DropDownChoice targetField = new DropDownChoice("target",
                    new PropertyModel(this, "document.target"), getTargetList());
            infoForm.add(targetLabel);
            infoForm.add(targetField);
            targetLabel.setVisibilityAllowed(true);
            targetField.setVisibilityAllowed(true);
            Label defaultPageLabel = new Label("defaultPage",
                    new ResourceModel("DefaultPage"));
            TextField defaultPageField = new TextField("defaultPageField",
                    new PropertyModel(this, "document.page"));
            infoForm.add(defaultPageLabel);
            infoForm.add(defaultPageField);
            defaultPageLabel.setVisibilityAllowed(true);
            defaultPageField.setVisibilityAllowed(true);
            final ModalWindow metaDataModalWindow;
            add(metaDataModalWindow = new ModalWindow("modalwindow"));
           
            AjaxButton addFolder = new AjaxButton("addFolder",new ResourceModel("add.subfolder"),infoForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    metaDataModalWindow.setContent(new AddFolderPanel(metaDataModalWindow.getContentId()));
                    metaDataModalWindow.show(target);
                }
            };
            infoForm.add(addFolder);
           
            AjaxButton addPage = new AjaxButton("addPage",new ResourceModel("add.page"),infoForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    metaDataModalWindow.setContent(new AddPagePanel(
                            metaDataModalWindow.getContentId()));
                    metaDataModalWindow.show(target);
                }
            };
            infoForm.add(addPage);
           
            AjaxButton addLink = new AjaxButton("addLink",new ResourceModel("add.link"),infoForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    metaDataModalWindow.setContent(new AddLinkPanel(metaDataModalWindow.getContentId()));
                    metaDataModalWindow.show(target);
                }
            };
            infoForm.add(addLink);
           
            addFolder.setVisibilityAllowed(true);
            addPage.setVisibilityAllowed(true);
            addLink.setVisibilityAllowed(true);
            SiteTreeNode node = getUserSelectedNode();
           
            if (node.getDocType() == SiteTreeNode.FileType.Folder)
            {
                urlLabel.setVisible(false);
                urlField.setVisible(false);
                targetLabel.setVisible(false);
                targetField.setVisible(false);
                addFolder.setVisible(true);
                addPage.setVisible(true);
                addLink.setVisible(true);
            }
            else if (node.getDocType() == SiteTreeNode.FileType.Page)
            {
                defaultPageLabel.setVisible(false);
                defaultPageField.setVisible(false);
                urlLabel.setVisible(false);
                urlField.setVisible(false);
                targetLabel.setVisible(false);
                targetField.setVisible(false);
                addFolder.setVisible(false);
                addPage.setVisible(false);
                addLink.setVisible(false);
            }
            else if (node.getDocType() == SiteTreeNode.FileType.Link)
            {
                defaultPageLabel.setVisible(false);
                defaultPageField.setVisible(false);
                targetLabel.setVisible(true);
                defaultPageField.setVisible(false);
                pageDecoratorLabel.setVisible(false);
                decoratorsList.setVisible(false);
                portletDecoratorLabel.setVisible(false);
                portletDecoratorsList.setVisible(false);
                themeField.setVisible(false);
                themeLabel.setVisible(false);
                addFolder.setVisible(false);
                addPage.setVisible(false);
                addLink.setVisible(false);
            }
           
            if (node.getDocType() == SiteTreeNode.FileType.Link)
            {
                ExternalLink viewLink = new ExternalLink("view", new Model(getDocument().getUrl()), new ResourceModel("common.view"))
                {
                    @Override
                    protected void onComponentTag(ComponentTag tag)
                    {
                        super.onComponentTag(tag);
                       
                        if (tag.getName().equalsIgnoreCase("input") && ((getLabel() != null) && (getLabel().getObject() != null)))
                        {
                            tag.put("value", getDefaultModelObjectAsString(getLabel().getObject()));
                        }
                    }
                };
                viewLink.setPopupSettings(new PopupSettings());
                infoForm.add(viewLink);
            }
            else
            {
                RequestContext context = (RequestContext) getPortletRequest().getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
                String basePath = context.getPortalURL().getBasePath().replace("portal", "configure");
                ExternalLink viewLink = new ExternalLink("view", new Model(basePath + getDocument().getPath()), new ResourceModel("common.view"))
                {
                    @Override
                    protected void onComponentTag(ComponentTag tag)
                    {
                        super.onComponentTag(tag);
                       
                        if (tag.getName().equalsIgnoreCase("input") && ((getLabel() != null) && (getLabel().getObject() != null)))
                        {
                            tag.put("value", getDefaultModelObjectAsString(getLabel().getObject()));
                        }
                    }
                };
                viewLink.setPopupSettings(new PopupSettings());
                infoForm.add(viewLink);
            }

            infoForm.add(new AjaxButton("remove",new ResourceModel("common.remove"),infoForm)
            {

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form form)
                {
                    excuteAction(getDocument(), REMOVE_ACTION);
                    DefaultMutableTreeNode node = getSelectedNode();
                    if (node != null && node.getParent() != null)
                    {
                        DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
                        parentNode.remove(node);
                        LinkTree tree = (PortalTree) getPage().get("siteTree");
                        tree.updateTree(target);
                    }
                }
            }.add(new JavascriptEventConfirmation("onclick", new ResourceModel("action.delete.confirm"))));
            infoForm.add(new AjaxButton("save",new ResourceModel("common.save"), infoForm)
            {

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form form)
                {
                    excuteAction(getDocument(), SAVE_ACTION);
                }
            });
            infoForm.add(new AjaxButton("copy",new ResourceModel("common.copy"),infoForm)
            {

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    SiteTreeNode selectedNode = getUserSelectedNode();
                    metaDataModalWindow.setContent(new CopyMoveWindow(
                            metaDataModalWindow.getContentId(), selectedNode
                                    .getDocType().name(), selectedNode
                                    .getNodeName(), getUserSelectedNode()
                                    .getNodePath(), true));
                    metaDataModalWindow.show(target);
                }
            });
            infoForm.add(new AjaxButton("move",new ResourceModel("common.move"),infoForm)
            {

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
View Full Code Here

            final String name = options.getOptions();
            this.optionsDefinition = new OptionsDefinitionBean(options);
            final Form menuform = new Form("menuForm");
            menuform.add(new TextField("optionsField", new PropertyModel(this,
                    "optionsDefinition.options")));
            menuform.add(new Label("optionLabel",new ResourceModel("menu.option")));
            menuform.add(new TextField("depthField", new PropertyModel(this,
                    "optionsDefinition.depth")));
            menuform.add(new Label("depthLabel",new ResourceModel("menu.depth")));
            menuform.add(new CheckBox("pathField", new PropertyModel(this,
                    "optionsDefinition.paths")));
            menuform.add(new Label("pathLabel",new ResourceModel("menu.path")));
            menuform.add(new CheckBox("regExpField", new PropertyModel(this,
                    "optionsDefinition.regexp")));
            menuform.add(new Label("regExpLabel",new ResourceModel("menu.regExp")));
            menuform.add(new TextField("profileField", new PropertyModel(this,
                    "optionsDefinition.profile")));
            menuform.add(new Label("profileLabel",new ResourceModel("menu.profile")));
            menuform.add(new TextField("skinField", new PropertyModel(this,
                    "optionsDefinition.skin")));
            menuform.add(new Label("skinLabel",new ResourceModel("menu.skin")));
            menuform.add(new TextField("orderField", new PropertyModel(this,
                    "optionsDefinition.order")));
            menuform.add(new Label("orderLabel",new ResourceModel("menu.order")));
            menuform.add(new AjaxButton("save",new ResourceModel("common.save"))
            {

                protected void onSubmit(AjaxRequestTarget target, Form menuform)
                {
                    menuActions(SAVE_ACTION,  name,
View Full Code Here

            feedback.setOutputMarkupId(true);
            add(feedback);
            Form menuform = new Form("menuForm");
            TextField nameField = new RequiredTextField("nameField",
                    new PropertyModel(this, "menuDef.name"));
            menuform.add(new Label("nameLabel",new ResourceModel("common.name")));
            menuform.add(nameField);
            TextField optionsField = new TextField("optionsField",
                    new PropertyModel(this, "menuDef.options"));
            menuform.add(new Label("optionLabel",new ResourceModel("menu.option")));
            menuform.add(optionsField);
            TextField depthField = new TextField("depthField",
                    new PropertyModel(this, "menuDef.depth"));
            menuform.add(new Label("depthLabel",new ResourceModel("menu.depth")));
            menuform.add(depthField);
            CheckBox pathField = new CheckBox("pathField", new PropertyModel(
                    this, "menuDef.paths"));
            menuform.add(new Label("pathLabel",new ResourceModel("menu.path")));
            menuform.add(pathField);
            CheckBox regExpField = new CheckBox("regExpField",
                    new PropertyModel(this, "menuDef.regexp"));
            menuform.add(new Label("regExpLabel",new ResourceModel("menu.regExp")));
            menuform.add(regExpField);
            TextField profileField = new TextField("profileField",
                    new PropertyModel(this, "menuDef.profile"));
            menuform.add(new Label("profileLabel",new ResourceModel("menu.profile")));
            menuform.add(profileField);
            TextField titleField = new TextField("titleField",
                    new PropertyModel(this, "menuDef.title"));
            menuform.add(new Label("titleLabel",new ResourceModel("menu.title")));
            menuform.add(titleField);
            TextField skinField = new TextField("skinField", new PropertyModel(
                    this, "menuDef.skin"));
            menuform.add(new Label("skinLabel",new ResourceModel("menu.skin")));
            menuform.add(skinField);
            TextField orderField = new TextField("orderField",
                    new PropertyModel(this, "menuDef.order"));
            menuform.add(new Label("orderLabel",new ResourceModel("menu.order")));
            menuform.add(orderField);
            menuform.add(new AjaxButton("save",new ResourceModel("common.save"), menuform)
            {

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
View Full Code Here

TOP

Related Classes of org.apache.wicket.model.ResourceModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.