Package org.apache.wicket.model

Examples of org.apache.wicket.model.ResourceModel


            final Form menuform = new Form("menuForm");
            menuform.add(new TextField("nameField", new PropertyModel(this,
                    "includes.name")));
            menuform.add(new CheckBox("nestField", new PropertyModel(this,
                    "includes.nest")));
            menuform.add(new Label("namelabel",new ResourceModel("common.name")));
            menuform.add(new Label("nestlabel",new ResourceModel("menu.nest.label")));
            menuform.add(new AjaxButton("save",new ResourceModel("common.save"),menuform)
            {

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


        {
            super(id);
            final String excludeName = excludes.getName();
            this.excludes = new ExcludesDefinitionBean(excludes);
            final Form menuform = new Form("menuForm");
            menuform.add(new Label("namelabel",new ResourceModel("common.name")));
            menuform.add(new TextField("nameField", new PropertyModel(this,
                    "excludes.name")));
            menuform.add(new AjaxButton("save",new ResourceModel("common.save"),menuform)
            {

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

            Form separatorForm = new Form("separatorDataForm");
            separatorForm.add(new TextField("separatorText", new PropertyModel(
                    this, "separator.text")));
            separatorForm.add(new TextField("separatorTitle",
                    new PropertyModel(this, "separator.title")));
            separatorForm.add(new Label("nameLabel",new ResourceModel("common.name")));
            separatorForm.add(new Label("titleLabel",new ResourceModel("common.title")));
            separatorForm.add(new AjaxButton("save",new ResourceModel("common.save"), separatorForm)
            {

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

            getMenuElements(definition, MenuElement.SEPARATOR_ELEMENT_TYPE);
            add(metaDataModalWindow = new ModalWindow("modalwindow"));
            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new Label("textLabel",new ResourceModel("menu.text")));
            ajaxPanel.add(new Label("titleLabel",new ResourceModel("menu.title")));
            ajaxPanel.add(new ListView("separator", new PropertyModel(this,
                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
                    final MenuSeparatorDefinition separator = (MenuSeparatorDefinition) listItem
                            .getModelObject();
                    listItem.add(new Label("text", separator.getText()));
                    listItem.add(new Label("title", separator.getTitle()));
                    AjaxLink editLink = new AjaxLink("edit")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataModalWindow.setContent(new SeparatorWindow(
                                    metaDataModalWindow.getContentId(),separator, ajaxPanel));
                            metaDataModalWindow.show(target);
                        }
                    };
                    editLink.add(new Label("editLabel",new ResourceModel("common.edit")));
                    listItem.add(editLink);
                    AjaxLink deleteLink = new AjaxLink("delete")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            menuActions(REMOVE_ACTION, separator.getText() ,new SeparatorDefinitionBean());
                            target.addComponent(ajaxPanel);
                        }                       
                    };
                    deleteLink.add(new Label("deleteLabel",new ResourceModel("common.delete")));
                    deleteLink.add(new JavascriptEventConfirmation("onclick",new ResourceModel("action.delete.confirm")))
                    listItem.add(deleteLink);
                }
            });
            Form separtorForm = new Form("sepForm");
            add(separtorForm);
            add(new AjaxButton("new",new ResourceModel("common.new"),separtorForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    MenuSeparatorDefinition separatorDefinition = null;
View Full Code Here

            final ModalWindow metaDataModalWindow;
            add(metaDataModalWindow = new ModalWindow("modalwindow"));
            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new Label("constraintLabel",new ResourceModel("security.constraint.title")));
            ajaxPanel.add(new Label("constraintTypeLabel",new ResourceModel("security.type.title")));
           
            ajaxPanel.add(new ListView("metaData", new PropertyModel(this,
                    "document.securityConstraints"))
            {

                public void populateItem(final ListItem listItem)
                {
                    final String constraints = (String) listItem
                            .getModelObject();
                    listItem.add(new Label("name", constraints));
                    listItem.add(new Label("type", new ResourceModel("security.ref")));
                    AjaxLink editLink = new AjaxLink("edit")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataModalWindow
                                    .setContent(new SecurityTabWindowPanel(
                                            metaDataModalWindow.getContentId(),
                                            constraints, ajaxPanel));
                            metaDataModalWindow.show(target);
                            target.addComponent(ajaxPanel);
                        }
                    };
                    editLink.add(new Label("editLabel",new ResourceModel("common.edit")));
                    listItem.add(editLink);
                   
                    AjaxLink deleteLink = new AjaxLink("delete")
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            securityConstraintAction(REMOVE_ACTION,
                                    constraints, "");
                            target.addComponent(ajaxPanel);
                        }
                    };
                    deleteLink.add(new JavascriptEventConfirmation("onclick",new ResourceModel("action.delete.confirm")));                   
                    deleteLink.add(new Label("deleteLabel",new ResourceModel("common.delete")));
                    listItem.add(deleteLink);
                }
            });
            Form securityForm = new Form("securityFrom");
            add(new AjaxButton("new",new ResourceModel("common.new"),securityForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    metaDataModalWindow.setContent(new SecurityTabWindowPanel(
View Full Code Here

            final ModalWindow metaDataModalWindow;
            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            add(metaDataModalWindow = new ModalWindow("modalwindow"));

            ajaxPanel.add(new Label("nameLabel", new ResourceModel(
                    "metedataTab.name")));
            ajaxPanel.add(new Label("languageLabel", new ResourceModel(
                    "metedataTab.language")));

            final ListView metaDataListView = new ListView("metaData",
                    new PropertyModel(this, "document.metaData"))
            {

                private static final long serialVersionUID = 1L;

                public void populateItem(final ListItem listItem)
                {
                    final JetspeedDocumentMetaData metaData = (JetspeedDocumentMetaData) listItem
                            .getModelObject();
                    listItem.add(new Label("name", metaData.getName()));
                    listItem.add(new Label("language", metaData.getLanguage()));
                    listItem.add(new Label("value", metaData.getValue()));
                    AjaxLink editLink = new AjaxLink("edit", new Model("edit"))
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataModalWindow.setContent(new MetaDataPanel(
                                    metaDataModalWindow.getContentId(),
                                    metaData, ajaxPanel));
                            metaDataModalWindow.show(target);
                        }
                    };
                    editLink.add(new Label("editLabel", new ResourceModel(
                            "common.edit")));
                    listItem.add(editLink);

                    AjaxLink deleteLink = new AjaxLink("delete", new Model(
                            "delete"))
                    {

                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataAction(REMOVE_ACTION, metaData, null);
                            target.addComponent(ajaxPanel);
                        }
                    };

                    deleteLink.add(new Label("deleteLabel", new ResourceModel(
                            "common.delete")));
                    deleteLink.add(new JavascriptEventConfirmation("onclick",
                            new ResourceModel("action.delete.confirm")));
                    listItem.add(deleteLink);
                }
            };
            metaDataListView.setOutputMarkupId(true);
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(metaDataListView);
            Form metaForm = new Form("metaForm");
            add(metaForm);
            add(new AjaxButton("new",new ResourceModel("common.new"),metaForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    metaDataModalWindow
View Full Code Here

            DropDownChoice constraintsChoices = new DropDownChoice(
                    "constraints", new PropertyModel(this, "constraintName"),
                    getConstraintsDef());
            constraintsChoices.setRequired(true);
            securityTabForm.add(constraintsChoices);
            securityTabForm.add(new AjaxButton("save",new ResourceModel("common.save"), securityTabForm)
            {

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

            FormComponent fc;
            fc = new RequiredTextField("name", new PropertyModel(this,
                    "metaData.name"));
            fc.add(StringValidator.minimumLength(2));
            metaDataForm.add(fc);
            metaDataForm.add(new Label("name-label", new ResourceModel(
                    "metedataTab.name")));
            fc = new RequiredTextField("language", new PropertyModel(this,
                    "metaData.language"));
            fc.add(StringValidator.minimumLength(2));
            metaDataForm.add(fc);
            metaDataForm.add(new Label("language-label", new ResourceModel(
                    "metedataTab.language")));
            fc = new RequiredTextField("metaValue", new PropertyModel(this,
                    "metaData.value"));
            fc.add(StringValidator.minimumLength(2));
            metaDataForm.add(fc);
            metaDataForm.add(new Label("value-label", new ResourceModel(
                    "metedataTab.value")));
            metaDataForm.add(new AjaxButton("save", new ResourceModel(
                    "common.save"), metaDataForm)
            {

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

                    getDocument().getDocumentOrder());
            final HiddenField pageOrder = new HiddenField("pageOrder",
                    new PropertyModel(this, "orderedList"));
            documentOrdering.add(documnetOrder);
            documentOrdering.add(pageOrder);
            documentOrdering.add(new AjaxButton("save",new ResourceModel("common.save"), documentOrdering)
            {

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

            menuTree.setRootLess(true);
            add(new ContextImage("menusRootIcon", "images/tree/folder.gif"));
            add(menuTree);
            Form menuForm = new Form("menuForm");
            add(menuForm);
            add(new AjaxButton("newsave",new ResourceModel("add.menu"),menuForm)
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    MenuDefinition def = null;
                    if (getNodeType().equals(FOLDER_NODE_TYPE))
                    {
                        def = getServiceLocator().getPageManager().newFolderMenuDefinition();
                    }
                    else
                    {
                        def = getServiceLocator().getPageManager().newPageMenuDefinition();
                    }
                    metaDataModalWindow.setContent(new MenuWindow(metaDataModalWindow.getContentId(), def, menusTab));
                    metaDataModalWindow.show(target);
                }
            });
            add(new AjaxButton("remove",new ResourceModel("common.remove"),menuForm)
            {

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
                    menuActions(REMOVE_ACTION, getMenuDefinition().getName(), new JetspeedMenuDefinition());
                    DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) menuTreeRoot
                            .getRoot();
                    DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(
                            new MenuTreeNode(getMenuDefinition().getName(),getServiceLocator()));
                    rootNode.remove(childNode);
                    menuTree.getTreeState().expandNode(rootNode);
                    menuTree.updateTree(target);
                    target.addComponent(menuTree);
                    target.addComponent(tabPanel);
                }
            }.add(new JavascriptEventConfirmation("onclick",new ResourceModel("action.delete.confirm"))));
            add(menusTab);
        }
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.