Search in sources :

Example 1 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class DropdownButtonPanel method initMenuItem.

private void initMenuItem(ListItem<InlineMenuItem> menuItem) {
    final InlineMenuItem item = menuItem.getModelObject();
    WebMarkupContainer menuItemBody = new MenuLinkPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
    menuItemBody.setRenderBodyOnly(true);
    menuItem.add(menuItemBody);
}
Also used : MenuLinkPanel(com.evolveum.midpoint.web.component.menu.cog.MenuLinkPanel) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 2 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class DropdownButtonPanel method initLayout.

private void initLayout(DropdownButtonDto model) {
    Label info = new Label(ID_INFO, model.getInfo());
    add(info);
    Label label = new Label(ID_LABEL, model.getLabel());
    add(label);
    WebMarkupContainer icon = new WebMarkupContainer(ID_ICON);
    icon.add(AttributeModifier.append("class", model.getIcon()));
    add(icon);
    ListView<InlineMenuItem> li = new ListView<InlineMenuItem>(ID_MENU_ITEM, new Model((Serializable) model.getMenuItems())) {

        @Override
        protected void populateItem(ListItem<InlineMenuItem> item) {
            initMenuItem(item);
        }
    };
    add(li);
}
Also used : Serializable(java.io.Serializable) ListView(org.apache.wicket.markup.html.list.ListView) Label(org.apache.wicket.markup.html.basic.Label) Model(org.apache.wicket.model.Model) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ListItem(org.apache.wicket.markup.html.list.ListItem) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 3 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class TreeTablePanel method initLayout.

protected void initLayout() {
    OrgTreePanel treePanel = new OrgTreePanel(ID_TREE_PANEL, getModel(), false) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void selectTreeItemPerformed(SelectableBean<OrgType> selected, AjaxRequestTarget target) {
            TreeTablePanel.this.selectTreeItemPerformed(selected, target);
        }

        protected List<InlineMenuItem> createTreeMenu() {
            return TreeTablePanel.this.createTreeMenu();
        }

        @Override
        protected List<InlineMenuItem> createTreeChildrenMenu(OrgType org) {
            return TreeTablePanel.this.createTreeChildrenMenu(org);
        }
    };
    treePanel.setOutputMarkupId(true);
    add(treePanel);
    add(createMemberPanel(treePanel.getSelected().getValue()));
    setOutputMarkupId(true);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) OrgTreePanel(com.evolveum.midpoint.web.page.admin.orgs.OrgTreePanel) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 4 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class ResourceTasksPanel method initLayout.

private void initLayout(final ListModel<TaskType> tasks) {
    final MainObjectListPanel<TaskType> tasksPanel = new MainObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, TableId.PAGE_RESOURCE_TASKS_PANEL, null, pageBase) {

        private static final long serialVersionUID = 1L;

        @Override
        protected BaseSortableDataProvider<SelectableBean<TaskType>> initProvider() {
            return new ListDataProvider2(pageBase, tasks);
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
            // TODO Auto-generated method stub
            //				super.objectDetailsPerformed(target, task);
            PageParameters parameters = new PageParameters();
            parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
            getPageBase().navigateToNext(PageTaskEdit.class, parameters);
        }

        @Override
        protected void newObjectPerformed(AjaxRequestTarget target) {
            getPageBase().navigateToNext(PageTaskAdd.class);
        }

        @Override
        protected List<IColumn<SelectableBean<TaskType>, String>> createColumns() {
            return ColumnUtils.getDefaultTaskColumns();
        }
    };
    //		final ObjectListPanel<TaskType> tasksPanel = new ObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, pageBase){
    //			
    //			@Override
    //			protected BaseSortableDataProvider<SelectableBean<TaskType>> getProvider() {
    //				return new ListDataProvider2(pageBase, tasks);
    //			}
    //			
    //			@Override
    //			public boolean isEditable() {
    //				return ResourceTasksPanel.this.editable;
    //			}
    //			
    //			@Override
    //			public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
    //				// TODO Auto-generated method stub
    //				super.objectDetailsPerformed(target, task);
    //				PageParameters parameters = new PageParameters();
    //		        parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
    //		        setResponsePage(new PageTaskEdit(parameters));
    //			}
    //		};
    //		tasksPanel.setEditable(false);
    tasksPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_TASK_BOX_CSS_CLASSES);
    add(tasksPanel);
    AjaxButton runNow = new AjaxButton(ID_RUN_NOW, pageBase.createStringResource("pageTaskEdit.button.runNow")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
            if (!oids.isEmpty()) {
                OperationResult result = TaskOperationUtils.runNowPerformed(pageBase.getTaskService(), oids);
                pageBase.showResult(result);
            } else {
                noTasksSelected();
            }
            target.add(pageBase.getFeedbackPanel());
        }
    };
    add(runNow);
    AjaxButton resume = new AjaxButton(ID_RESUME, pageBase.createStringResource("pageTaskEdit.button.resume")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
            if (!oids.isEmpty()) {
                OperationResult result = TaskOperationUtils.resumePerformed(pageBase.getTaskService(), oids);
                pageBase.showResult(result);
            } else {
                noTasksSelected();
            }
            target.add(pageBase.getFeedbackPanel());
        }
    };
    add(resume);
    AjaxButton suspend = new AjaxButton(ID_SUSPEND, pageBase.createStringResource("pageTaskEdit.button.suspend")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
            if (!oids.isEmpty()) {
                OperationResult result = TaskOperationUtils.suspendPerformed(pageBase.getTaskService(), oids);
                pageBase.showResult(result);
            } else {
                noTasksSelected();
            }
            target.add(pageBase.getFeedbackPanel());
        }
    };
    add(suspend);
}
Also used : MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) ListDataProvider2(com.evolveum.midpoint.web.component.util.ListDataProvider2) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 5 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class ResourceContentPanel method createHeaderMenuItems.

private List<InlineMenuItem> createHeaderMenuItems() {
    List<InlineMenuItem> items = new ArrayList<InlineMenuItem>();
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.enableAccounts"), true, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            updateResourceObjectStatusPerformed(null, target, true);
        }
    }));
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.disableAccounts"), true, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            updateResourceObjectStatusPerformed(null, target, false);
        }
    }));
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.deleteAccounts"), true, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            deleteResourceObjectPerformed(null, target);
        }
    }));
    items.add(new InlineMenuItem());
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.importAccounts"), true, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            importResourceObject(null, target);
        }
    }));
    items.add(new InlineMenuItem());
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.removeOwners"), true, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            changeOwner(null, target, null, Operation.REMOVE);
        }
    }));
    return items;
}
Also used : HeaderMenuAction(com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Form(org.apache.wicket.markup.html.form.Form) ArrayList(java.util.ArrayList) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Aggregations

InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)114 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)82 ArrayList (java.util.ArrayList)68 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)47 InlineMenuItemAction (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction)43 IModel (org.apache.wicket.model.IModel)41 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)35 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)30 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)26 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)25 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)24 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)19 Label (org.apache.wicket.markup.html.basic.Label)18 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)17 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)15 Form (org.apache.wicket.markup.html.form.Form)15 SelectableBeanImpl (com.evolveum.midpoint.web.component.util.SelectableBeanImpl)13 HeaderMenuAction (com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction)13 ListItem (org.apache.wicket.markup.html.list.ListItem)12 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)11