Java Code Examples for org.apache.wicket.markup.html.WebMarkupContainer.addOrReplace()

The following are Jave code examples for showing how to use addOrReplace() of the org.apache.wicket.markup.html.WebMarkupContainer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: engerek   File: PolicyRulesPanel.java   Source Code and License Vote up 6 votes
private void initLayout(){
        WebMarkupContainer policyRulesContainer = new WebMarkupContainer(ID_POLICY_RULES);
        policyRulesContainer.setOutputMarkupId(true);
        add(policyRulesContainer);

        ListDataProvider<AssignmentEditorDto> provider = new ListDataProvider<AssignmentEditorDto>(this, getModel(), false);
        BoxedTablePanel<AssignmentEditorDto> policyRulesTable = new BoxedTablePanel<AssignmentEditorDto>(ID_MAIN_POLICY_RULE_PANEL,
                provider, initColumns(), UserProfileStorage.TableId.POLICY_RULES_TAB_TABLE,
                (int) pageBase.getItemsPerPage(UserProfileStorage.TableId.POLICY_RULES_TAB_TABLE)){
            private static final long serialVersionUID = 1L;

            @Override
            public int getItemsPerPage() {
                return pageBase.getSessionStorage().getUserProfile().getTables().get(UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE);
            }

        };
        policyRulesTable.setOutputMarkupId(true);
//        policyRulesTable.setCurrentPage(getPaging());
        policyRulesContainer.addOrReplace(policyRulesTable);

    }
 
Example 2
Project: engerek   File: DelegationEditorPanel.java   Source Code and License Vote up 6 votes
private void addPrivilegesPanel(WebMarkupContainer body){
    privilegesNames = getPrivilegesNamesList();
    ListView<String> privilegesListComponent = new ListView<String>(ID_PRIVILEGES_LIST, privilegesNames){
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<String> item) {
            Label privilageNameLabel = new Label(ID_PRIVILEGE, item.getModel());
            item.add(privilageNameLabel);
        }
    };
    privilegesListComponent.setOutputMarkupId(true);
    privilegesListComponent.add(new VisibleEnableBehaviour(){
        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible(){
            if (!UserDtoStatus.ADD.equals(getModelObject().getStatus())){
                return true;
            }
           return false;
        }
    });
    body.addOrReplace(privilegesListComponent);
}
 
Example 3
Project: engerek   File: AssignmentCatalogPanel.java   Source Code and License Vote up 6 votes
private void addOrReplaceSearchPanel(WebMarkupContainer headerPanel) {
    final Form searchForm = new Form(ID_SEARCH_FORM);
    searchForm.add(new VisibleEnableBehaviour() {
        public boolean isVisible() {
            return !isCatalogOidEmpty()
                    && !AssignmentViewType.USER_TYPE.equals( getRoleCatalogStorage().getViewType());
        }
    });
    searchForm.setOutputMarkupId(true);

    SearchPanel search = new SearchPanel(ID_SEARCH, (IModel) searchModel, false) {
        private static final long serialVersionUID = 1L;

        @Override
        public void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
            AssignmentCatalogPanel.this.searchPerformed(query, target);
        }
    };
    searchForm.add(search);
    headerPanel.addOrReplace(searchForm);
}
 
Example 4
Project: engerek   File: MergeObjectsPanel.java   Source Code and License Vote up 6 votes
private void initObjectsPanel(WebMarkupContainer objectsPanel){

        MergeObjectDetailsPanel mergeObjectPanel = new MergeObjectDetailsPanel(ID_MERGE_OBJECT_DETAILS_PANEL,
                mergeObjectModel.getObject(), type);
        mergeObjectPanel.setOutputMarkupId(true);
        objectsPanel.addOrReplace(mergeObjectPanel);

        MergeObjectDetailsPanel mergeWithObjectPanel = new MergeObjectDetailsPanel(ID_MERGE_WITH_OBJECT_DETAILS_PANEL,
                mergeWithObjectModel.getObject(), type);
        mergeWithObjectPanel.setOutputMarkupId(true);
        objectsPanel.addOrReplace(mergeWithObjectPanel);

        mergeResultObject = getMergeObjectsResult();

        WebMarkupContainer mergeResultPanelContainer = new WebMarkupContainer(ID_MERGE_RESULT_PANEL_CONTAINER);
        mergeResultPanelContainer.setOutputMarkupId(true);
        objectsPanel.addOrReplace(mergeResultPanelContainer);
        mergeResultPanelContainer.addOrReplace(getMergeResultObjectPanel());
    }
 
Example 5
Project: engerek   File: PageImportObject.java   Source Code and License Vote up 6 votes
private void addOrReplaceEditor(WebMarkupContainer inputAce) {
	AceEditor editor = new AceEditor(ID_ACE_EDITOR, xmlEditorModel);
	editor.setOutputMarkupId(true);
	editor.setModeForDataLanguage(dataLanguage);
	editor.add(new AjaxFormComponentUpdatingBehavior("blur") {
		@Override
		protected void onUpdate(AjaxRequestTarget target) {
		}
	});
	inputAce.addOrReplace(editor);
}
 
Example 6
Project: engerek   File: MainPopupDialog.java   Source Code and License Vote up 5 votes
public void setBody(Popupable popupable){
	setTitle(popupable.getTitle());
	setInitialHeight(popupable.getHeight());
	setInitialWidth(popupable.getWidth());
	WebMarkupContainer content = (WebMarkupContainer) get(getContentId());
	popupable.getComponent().setOutputMarkupId(true);
	content.addOrReplace(popupable.getComponent());
}
 
Example 7
Project: engerek   File: PageAuditLogDetails.java   Source Code and License Vote up 5 votes
private void initDeltasPanel(WebMarkupContainer eventPanel){
    List<ObjectDeltaOperationType> deltas = recordModel.getObject().getDelta();
    RepeatingView deltaScene = new RepeatingView(ID_DELTA_LIST_PANEL);

    for(ObjectDeltaOperationType deltaOp :deltas){
        ObjectDeltaOperationPanel deltaPanel = new ObjectDeltaOperationPanel(deltaScene.newChildId(), Model.of(deltaOp), this);
        deltaPanel.setOutputMarkupId(true);
        deltaScene.add(deltaPanel);


    }
    eventPanel.addOrReplace(deltaScene);

}
 
Example 8
Project: engerek   File: MainPopupDialog.java   Source Code and License Vote up 4 votes
private void setBody(Component component){
	WebMarkupContainer content = (WebMarkupContainer) get(getContentId());
	content.addOrReplace(component);
}
 
Example 9
Project: engerek   File: AssignmentDataTablePanel.java   Source Code and License Vote up 4 votes
private void addOrReplaceAssignmentsTable(WebMarkupContainer assignmentsContainer){
    fillInRelationAssignmentsMap();
    DropDownChoicePanel relation = WebComponentUtil.createEnumPanel(RelationTypes.class, ID_RELATION,
            WebComponentUtil.createReadonlyModelFromEnum(RelationTypes.class), relationModel, this, false);
    relation.getBaseFormComponent().add(new AjaxFormComponentUpdatingBehavior("change") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            relationModel.setObject((RelationTypes)relation.getBaseFormComponent().getConvertedInput());
            addOrReplaceAssignmentsTable(getAssignmentsContainer());
            target.add(AssignmentDataTablePanel.this.get(ID_ASSIGNMENTS).get(ID_ASSIGNMENTS_TABLE));
        }
    });
    relation.setOutputMarkupId(true);
    relation.setOutputMarkupPlaceholderTag(true);
    assignmentsContainer.addOrReplace(relation);

    AjaxButton showAllAssignmentsButton = new AjaxButton(ID_SHOW_ALL_ASSIGNMENTS_BUTTON,
            createStringResource("AssignmentTablePanel.menu.showAllAssignments")) {
        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            showAllAssignments(ajaxRequestTarget);
        }
    };
    assignmentsContainer.addOrReplace(showAllAssignmentsButton);

    ListDataProvider<AssignmentEditorDto> assignmentsProvider = new ListDataProvider<AssignmentEditorDto>(this,
            Model.ofList(relationAssignmentsMap.get(relationModel.getObject())), false){
        private static final long serialVersionUID = 1L;

        @Override
        protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
            getAssignmentsStorage().setPaging(paging);
        }

    };
    BoxedTablePanel<AssignmentEditorDto> assignmentTable = new BoxedTablePanel<AssignmentEditorDto>(ID_ASSIGNMENTS_TABLE,
            assignmentsProvider, initColumns(), UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE,
            (int) pageBase.getItemsPerPage(UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE)){
        private static final long serialVersionUID = 1L;

        @Override
        protected Item<AssignmentEditorDto> customizeNewRowItem(Item<AssignmentEditorDto> item, IModel<AssignmentEditorDto> model) {
                item.add(AttributeModifier.append("class", AssignmentsUtil.createAssignmentStatusClassModel(model)));
            return item;
        }

        @Override
        public int getItemsPerPage() {
            return pageBase.getSessionStorage().getUserProfile().getTables().get(UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE);
        }

    };
    assignmentTable.setOutputMarkupId(true);
    assignmentTable.setCurrentPage(getAssignmentsStorage().getPaging());
    assignmentsContainer.addOrReplace(assignmentTable);

}
 
Example 10
Project: engerek   File: PageAuditLogDetails.java   Source Code and License Vote up 4 votes
private void initAuditLogHistoryPanel(WebMarkupContainer eventPanel){
    AuditEventRecordProvider provider = new AuditEventRecordProvider(PageAuditLogDetails.this){
        private static final long serialVersionUID = 1L;

        public Map<String, Object> getParameters() {
            Map<String, Object> parameters = new HashMap<String, Object>();
            parameters.put(TASK_IDENTIFIER_PARAMETER, recordModel.getObject().getTaskIdentifier());
            return parameters;
        }
    };


    BoxedTablePanel<AuditEventRecordType> table = new BoxedTablePanel<AuditEventRecordType>(
            ID_HISTORY_PANEL, provider, initColumns(), UserProfileStorage.TableId.TASK_EVENTS_TABLE, TASK_EVENTS_TABLE_SIZE) {

        @Override
        protected Item<AuditEventRecordType> customizeNewRowItem(final Item<AuditEventRecordType> item,
                                                                 final IModel<AuditEventRecordType> rowModel) {

            if (rowModel.getObject().getTimestamp().equals(recordModel.getObject().getTimestamp())){
                item.add(new AttributeAppender("style", "background-color: #eee; border-color: #d6d6d6; color: #000"));
            }

            item.add(new AjaxEventBehavior("click") {
                private static final long serialVersionUID = 1L;

                @Override
                protected void onEvent(AjaxRequestTarget target) {
                    PageAuditLogDetails.this.rowItemClickPerformed(target, item, rowModel);
                }
            });
            return item;
        }
    };
    table.getFooterMenu().setVisible(false);
    table.getFooterCountLabel().setVisible(false);
    //TODO hidden temporarily
    table.setVisible(false);
    table.setOutputMarkupId(true);
    table.setAdditionalBoxCssClasses("without-box-header-top-border");
    eventPanel.addOrReplace(table);

}