当前位置: 首页>>代码示例>>Java>>正文


Java WebMarkupContainer类代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.WebMarkupContainer的典型用法代码示例。如果您正苦于以下问题:Java WebMarkupContainer类的具体用法?Java WebMarkupContainer怎么用?Java WebMarkupContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WebMarkupContainer类属于org.apache.wicket.markup.html包,在下文中一共展示了WebMarkupContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newSuggestionItem

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
private Component newSuggestionItem(String itemId, InputCompletion suggestion) {
	WebMarkupContainer item = new WebMarkupContainer(itemId);
	WebMarkupContainer link = new WebMarkupContainer("link");
	Range matchRange = suggestion.getMatchRange();
	String label = suggestion.getLabel();
	if (matchRange != null) {
		String prefix = StringEscapeUtils.escapeHtml4(label.substring(0, matchRange.getFrom()));
		String suffix = StringEscapeUtils.escapeHtml4(label.substring(matchRange.getTo()));
		String matched = StringEscapeUtils.escapeHtml4(label.substring(matchRange.getFrom(), matchRange.getTo()));
		link.add(new Label("label", prefix + "<b>" + matched + "</b>" + suffix).setEscapeModelStrings(false));
	} else {
		link.add(new Label("label", label));
	}
	item.add(link);
	if (suggestion.getDescription() != null)
		item.add(new Label("description", suggestion.getDescription()));
	else
		item.add(new Label("description").setVisible(false));
	item.add(AttributeAppender.append("data-content", suggestion.complete(inputStatus).getContent()));
	item.add(AttributeAppender.append("data-caret", suggestion.getCaret()));
	item.setOutputMarkupId(true);
	return item;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:AssistPanel.java

示例2: newManageContainer

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
private WebMarkupContainer newManageContainer() {
	WebMarkupContainer container = new WebMarkupContainer("manage");
	container.setVisible(SecurityUtils.canModify(getPullRequest()));
	container.add(new Link<Void>("synchronize") {

		@Override
		public void onClick() {
			GitPlex.getInstance(PullRequestManager.class).check(getPullRequest());
			Session.get().success("Pull request is synchronized");
		}
		
	});
	container.add(new Link<Void>("delete") {

		@Override
		public void onClick() {
			PullRequest request = getPullRequest();
			GitPlex.getInstance(PullRequestManager.class).delete(request);
			Session.get().success("Pull request #" + request.getNumber() + " is deleted");
			setResponsePage(RequestListPage.class, RequestListPage.paramsOf(getProject()));
		}
		
	}.add(new ConfirmOnClick("Do you really want to delete this pull request?")));
	return container;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:26,代码来源:RequestOverviewPage.java

示例3: getPropertyEditorsAtRow

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<PropertyEditor<Serializable>> getPropertyEditorsAtRow(int index) {
	WebMarkupContainer table = (WebMarkupContainer) get("listEditor");
	RepeatingView rows = (RepeatingView) table.get("elements");

	int currentIndex = 0;
	Iterator<Component> it = rows.iterator();
	Component row = it.next();
	while (currentIndex++ < index) {
		row = it.next();
	}
	
	List<PropertyEditor<Serializable>> propertyEditors = new ArrayList<>();
	RepeatingView columns = (RepeatingView) row.get("properties");
	for (Component column: columns) {
		propertyEditors.add((PropertyEditor<Serializable>) column.get("propertyEditor"));
	}
	
	return propertyEditors;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:21,代码来源:ConcreteListPropertyEditor.java

示例4: onInitialize

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(new UserLink("author", author));
	if (committer.getEmailAddress().equals(author.getEmailAddress())
			&& committer.getName().equals(author.getName())) {
		add(new WebMarkupContainer("committer").setVisible(false));
	} else {
		add(new UserLink("committer", committer));
	}
	if (withDate)
		add(new Label("date", DateUtils.formatAge(committer.getWhen())));
	else
		add(new WebMarkupContainer("date").setVisible(false));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:17,代码来源:ContributorPanel.java

示例5: render

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@Override
public Component render(String componentId) {
	return new ActionTabLink(componentId, this) {

		@Override
		protected WebMarkupContainer newLink(String id, ActionTab tab) {
			return new AjaxLink<Void>("link") {

				@Override
				public void onClick(AjaxRequestTarget target) {
					selectTab(this);
				}
				
			};
		}
		
	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:19,代码来源:AjaxActionTab.java

示例6: newAddReplyContainer

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
private WebMarkupContainer newAddReplyContainer() {
	WebMarkupContainer addReplyContainer = new Fragment("addReply", "addReplyFrag", this) {

		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(SecurityUtils.getUser() != null);
		}
		
	};
	addReplyContainer.setOutputMarkupId(true);
	addReplyContainer.add(new AjaxLink<Void>("reply") {

		@Override
		public void onClick(AjaxRequestTarget target) {
			onAddReply(target, false, null);
		}
		
	});
	return addReplyContainer;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:CodeCommentPanel.java

示例7: newSinceChangesRow

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
private Component newSinceChangesRow(String id, Date sinceDate) {
	WebMarkupContainer row = new WebMarkupContainer(id);
	row.setOutputMarkupId(true);
	row.add(AttributeAppender.append("class", " non-discussion"));
	
	WebMarkupContainer avatarColumn = new WebMarkupContainer("avatar");
	avatarColumn.add(new WebMarkupContainer("avatar"));
	row.add(avatarColumn);
	
	WebMarkupContainer contentColumn = new Fragment("content", "sinceChangesRowContentFrag", this);
	contentColumn.add(new SinceChangesLink("sinceChanges", requestModel, sinceDate));
	row.add(contentColumn);
	
	row.add(AttributeAppender.append("class", "since-changes"));
	
	return row;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:18,代码来源:RequestOverviewPage.java

示例8: newOptions

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@Override
protected WebMarkupContainer newOptions(String id) {
	sourceFormat = new SourceFormatPanel(id, null, new OptionChangeCallback() {
		
		@Override
		public void onOptioneChange(AjaxRequestTarget target) {
			String script = String.format("gitplex.server.sourceView.onTabSizeChange(%s);", sourceFormat.getTabSize());
			target.appendJavaScript(script);
		}
		
	}, new OptionChangeCallback() {

		@Override
		public void onOptioneChange(AjaxRequestTarget target) {
			String script = String.format("gitplex.server.sourceView.onLineWrapModeChange('%s');", sourceFormat.getLineWrapMode());
			target.appendJavaScript(script);
		}
		
	});
	return sourceFormat;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:SourceViewPanel.java

示例9: newAdditionalActions

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@Override
public WebMarkupContainer newAdditionalActions(String id) {
	WebMarkupContainer actions = new Fragment(id, "actionsFrag", this);
	if (!symbols.isEmpty()) {
		actions.add(new CheckBox("outline", Model.of(isOutlineVisibleInitially())).add(new OnChangeAjaxBehavior() {

			@Override
			protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
				super.updateAjaxAttributes(attributes);
				attributes.setMethod(Method.POST);
			}

			@Override
			protected void onUpdate(AjaxRequestTarget target) {
				toggleOutline(target);
			}
			
		}));
	} else {
		actions.add(new WebMarkupContainer("outline").setVisible(false));
	}
	return actions;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:SourceViewPanel.java

示例10: onInitialize

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();

	add(new ResourceLink<Void>("download", new ServerLogResourceReference()));
	
	List<String> lines = ServerLogResource.readServerLog();		
	String content;
	if (lines.size() > MAX_DISPLAY_LINES) {
		add(new Label("warning", "Too many log entries, displaying recent " + MAX_DISPLAY_LINES));
		content = Joiner.on("\n").join(lines.subList(lines.size()-MAX_DISPLAY_LINES, lines.size()));
	} else {
		add(new WebMarkupContainer("warning").setVisible(false));
		content = Joiner.on("\n").join(lines);
	}
	
	add(new Label("logContent", content));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:19,代码来源:ServerLogPage.java

示例11: onInitialize

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();

	add(new Label("title", initStage.getMessage()));
	
	if (!initStage.getManualConfigs().isEmpty()) {
		List<ManualConfigStep> configSteps = new ArrayList<ManualConfigStep>();
		for (ManualConfig each: initStage.getManualConfigs())
			configSteps.add(new ManualConfigStep(each));
		add(new Wizard("wizard", configSteps) {

			@Override
			protected void finished() {
				WebSession.get().logout();
				User root = GitPlex.getInstance(UserManager.class).getRoot();
				SecurityUtils.getSubject().runAs(root.getPrincipals());
				throw new RestartResponseException(DashboardPage.class);
			}
			
		});
	} else {
		add(new WebMarkupContainer("wizard").setVisible(false));
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:26,代码来源:ServerInitPage.java

示例12: populateNode

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
    ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<NodeDto> item) {
            NodeDto node = item.getModelObject();
            BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
            item.add(link);
        }
    };
    add(list);
    WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
    add(container);
    container.setVisible(this.model.isVisible());
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:17,代码来源:LocationViewPage.java

示例13: RichHyperlinkConfigDialog

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
public RichHyperlinkConfigDialog(String id, final RichHyperlinkType link, boolean isMenuItem, String titleKey){
    super(id);

    this.isMenuItem = isMenuItem;
    model = new LoadableModel<RichHyperlinkType>(false) {

        @Override
        protected RichHyperlinkType load() {
            return loadModel(link);
        }
    };

    setOutputMarkupId(true);
    setTitle(createStringResource(titleKey));
    showUnloadConfirmation(false);
    setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    setCookieName(RichHyperlinkConfigDialog.class.getSimpleName() + ((int) (Math.random() * 100)));
    setInitialWidth(625);
    setInitialHeight(400);
    setWidthUnit("px");

    WebMarkupContainer content = new WebMarkupContainer(getContentId());
    content.setOutputMarkupId(true);
    setContent(content);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:RichHyperlinkConfigDialog.java

示例14: addOrReplaceTable

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
private void addOrReplaceTable(RepositoryObjectDataProvider provider) {
	Form mainForm = (Form) get(ID_MAIN_FORM);

	BoxedTablePanel table = new BoxedTablePanel(ID_TABLE, provider, initColumns(provider.getType()),
			UserProfileStorage.TableId.CONF_DEBUG_LIST_PANEL,
			(int) getItemsPerPage(UserProfileStorage.TableId.CONF_DEBUG_LIST_PANEL)) {

		@Override
		protected WebMarkupContainer createHeader(String headerId) {
			return new SearchFragment(headerId, ID_TABLE_HEADER, PageDebugList.this, searchModel,
					resourcesModel);
		}

	};
	table.setOutputMarkupId(true);

	ConfigurationStorage storage = getSessionStorage().getConfiguration();
	table.setCurrentPage(storage.getPaging());

	mainForm.addOrReplace(table);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:22,代码来源:PageDebugList.java

示例15: initLayout

import org.apache.wicket.markup.html.WebMarkupContainer; //导入依赖的package包/类
public void initLayout(final String messageKey){
    WebMarkupContainer content = new WebMarkupContainer(ID_CONTENT);
    add(content);

    Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return getString(messageKey);
        }
    });
    helpLabel.setEscapeModelStrings(false);
    content.add(helpLabel);

    AjaxLink ok = new AjaxLink(ID_BUTTON_OK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            closePerformed(target);
        }
    };
    content.add(ok);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:24,代码来源:HelpInfoPanel.java


注:本文中的org.apache.wicket.markup.html.WebMarkupContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。