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


Java Component类代码示例

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


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

示例1: populateItem

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected void populateItem(Item<Var> item) {
    String name = item.getModel().getObject().getName();
    item.add(new AjaxLink("show") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            selectedName = name;
            Component headerPanel = getPage().get(BasePage.STICKY_HEADER_ID);
            VarModel varModel = new VarModel(model.getSessionId(), name);
            VarPanel varPanel = new VarPanel(BasePage.STICKY_HEADER_ID, varModel, VarsRefreshingView.this);                
            headerPanel = headerPanel.replaceWith(varPanel);
            target.add(headerPanel);
            Component varsPanel = getPage().get(BasePage.LEFT_NAV_ID);
            target.add(varsPanel);
        }
    }.add(new Label("name", name)));
    String type = item.getModel().getObject().getValue().getTypeAsShortString();
    item.add(new Label("type", type));
    if (name.equals(selectedName)) {
        item.add(new AttributeModifier("class", "success"));
    }
}
 
开发者ID:intuit,项目名称:karate,代码行数:23,代码来源:VarsRefreshingView.java

示例2: getBreadcrumbs

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected List<ComponentRenderer> getBreadcrumbs() {
	List<ComponentRenderer> breadcrumbs = super.getBreadcrumbs();
	
	breadcrumbs.add(new ComponentRenderer() {

		@Override
		public Component render(String componentId) {
			return new ViewStateAwarePageLink<Void>(componentId, UserListPage.class) {

				@Override
				public IModel<?> getBody() {
					return Model.of("Users");
				}
				
			};
		}
		
	});

	return breadcrumbs;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:23,代码来源:UserListPage.java

示例3: getBreadcrumbs

import org.apache.wicket.Component; //导入依赖的package包/类
protected List<ComponentRenderer> getBreadcrumbs() {
	List<ComponentRenderer> breadcrumbs = new ArrayList<>();
	
	breadcrumbs.add(new ComponentRenderer() {
		
		@Override
		public Component render(String componentId) {
			return new ViewStateAwarePageLink<Void>(componentId, DashboardPage.class) {

				@Override
				public IModel<?> getBody() {
					return Model.of("Home");
				}
				
			};
		}
	});
	
	return breadcrumbs;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:21,代码来源:LayoutPage.java

示例4: getRenderer

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public PrioritizedComponentRenderer getRenderer(BlobRenderContext context) {
	return new PrioritizedComponentRenderer() {

		private static final long serialVersionUID = 1L;

		@Override
		public Component render(String componentId) {
			return new FailsafeViewPanel(componentId, context);
		}

		@Override
		public int getPriority() {
			return Integer.MAX_VALUE;
		}
		
	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:19,代码来源:FailsafeRendererProvider.java

示例5: newBlobContent

import org.apache.wicket.Component; //导入依赖的package包/类
private void newBlobContent(@Nullable AjaxRequestTarget target) {
	PrioritizedComponentRenderer mostPrioritizedRenderer = null;
	for (BlobRendererContribution contribution: GitPlex.getExtensions(BlobRendererContribution.class)) {
		PrioritizedComponentRenderer renderer = contribution.getRenderer(this);
		if (renderer != null) {
			if (mostPrioritizedRenderer == null || mostPrioritizedRenderer.getPriority() > renderer.getPriority())
				mostPrioritizedRenderer = renderer;
		}
	}
	Component blobContent = Preconditions.checkNotNull(mostPrioritizedRenderer).render(BLOB_CONTENT_ID);
	if (target != null) {
		replace(blobContent);
		target.add(blobContent);
	} else {
		add(blobContent);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:18,代码来源:ProjectBlobPage.java

示例6: getBreadcrumbs

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected List<ComponentRenderer> getBreadcrumbs() {
	List<ComponentRenderer> breadcrumbs = super.getBreadcrumbs();
	
	breadcrumbs.add(new ComponentRenderer() {

		@Override
		public Component render(String componentId) {
			return new ViewStateAwarePageLink<Void>(componentId, GroupListPage.class) {

				@Override
				public IModel<?> getBody() {
					return Model.of("Groups");
				}
				
			};
		}
		
	});

	return breadcrumbs;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:23,代码来源:GroupListPage.java

示例7: getPropertyEditorsAtRow

import org.apache.wicket.Component; //导入依赖的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

示例8: getRenderer

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public PrioritizedComponentRenderer getRenderer(BlobRenderContext context) {
	if (context.getMode() == Mode.ADD && context.getNewPath() == null) {
		return new PrioritizedComponentRenderer() {
			
			private static final long serialVersionUID = 1L;

			@Override
			public Component render(String componentId) {
				return new NoNameEditPanel(componentId, context);
			}
			
			@Override
			public int getPriority() {
				return 0;
			}
		};
	} else {
		return null;
	}		
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:NoNameRendererProvider.java

示例9: getSourceAware

import org.apache.wicket.Component; //导入依赖的package包/类
@Nullable
private SourceAware getSourceAware(String path) {
	return diffsView.visitChildren(new IVisitor<Component, SourceAware>() {

		@SuppressWarnings("unchecked")
		@Override
		public void component(Component object, IVisit<SourceAware> visit) {
			if (object instanceof ListItem) {
				ListItem<BlobChange> item = (ListItem<BlobChange>) object;
				if (item.getModelObject().getPaths().contains(path)) {
					visit.stop((SourceAware) item.get(DIFF_ID));
				} else {
					visit.dontGoDeeper();
				}
			} 
		}

	});
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:20,代码来源:RevisionDiffPanel.java

示例10: onClick

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void onClick(AjaxRequestTarget target) {
	// if modal has not been created, or has been removed from page 
	// when the same page instance is refreshed 
	if (modal == null || modal.getParent() == null) {
		modal = new ModalPanel(target) {

			@Override
			protected Component newContent(String id) {
				return ModalLink.this.newContent(id, this);
			}

			@Override
			protected void onClosed() {
				super.onClosed();
				modal = null;
			}
			
		};
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:ModalLink.java

示例11: onInitialize

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(new DropdownLink("status") {

		@Override
		protected Component newContent(String id, FloatingPanel floating) {
			return new VerificationDetailPanel(id, VerificationStatusPanel.this.getModel());
		}

		@Override
		protected void onComponentTag(ComponentTag tag) {
			super.onComponentTag(tag);

			Collection<Verification> verifications = VerificationStatusPanel.this.getModelObject().values();
			if (hasStatus(verifications, Status.ERROR)) {
				tag.put("class", "verification-status error fa fa-warning");
				tag.put("title", "Some verifications are in error, click for details");
			} else if (hasStatus(verifications, Status.FAILURE)) {
				tag.put("class", "verification-status failure fa fa-times");
				tag.put("title", "Some verifications are failed, click for details");
			} else if (hasStatus(verifications, Status.RUNNING)) {
				tag.put("class", "verification-status running fa fa-circle");
				tag.put("title", "Some verifications are running, click for details");
			} else if (hasStatus(verifications, Status.SUCCESS)) {
				tag.put("class", "verification-status success fa fa-check");
				tag.put("title", "Verifications are successful, click for details");
			}
		}
		
	});
	
	setOutputMarkupPlaceholderTag(true);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:36,代码来源:VerificationStatusPanel.java

示例12: VarPanel

import org.apache.wicket.Component; //导入依赖的package包/类
public VarPanel(String id, VarModel model, VarsRefreshingView varsView) {
	super(id);
       IModel<String> txtModel = new IModel<String>() {
           @Override
           public String getObject() {
               return model.getObject().getValue().getAsString();
           }            
           @Override
           public void setObject(String object) {
              
           }
           @Override
           public void detach() {}
       };
       add(new TextArea("value", txtModel));
       String title = model.getObject().getName() + " - " + model.getObject().getValue().getType();
       add(new Label("title", title));
       add(new AjaxLink("close") {
           @Override
           public void onClick(AjaxRequestTarget target) {
               varsView.setSelectedName(null);
               Component headerPanel = VarPanel.this;
               headerPanel = headerPanel.replaceWith(new Label(BasePage.STICKY_HEADER_ID, ""));
               target.add(headerPanel);
               Component varsPanel = varsView.getParent();
               target.add(varsPanel);                        
           }
       });
}
 
开发者ID:intuit,项目名称:karate,代码行数:30,代码来源:VarPanel.java

示例13: renderHead

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void renderHead(Component component, IHeaderResponse response) {
	super.renderHead(component, response);
	
	response.render(JavaScriptHeaderItem.forReference(new DropdownHoverResourceReference()));
	String script = String.format("gitplex.server.dropdownhover.init('%s', %s, %s);", 
			getComponent().getMarkupId(true), hoverDelay, getCallbackFunction());
	response.render(OnDomReadyHeaderItem.forScript(script));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:10,代码来源:DropdownHover.java

示例14: onComponentTag

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void onComponentTag(Component component, ComponentTag tag) {
	String original = tag.getAttribute("title");
	
	super.onComponentTag(component, tag);
	
	// hack here
	String current = tag.getAttribute("title");
	if (!Strings.isNullOrEmpty(original) && Strings.isNullOrEmpty(current)) {
		tag.put("title", original);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:13,代码来源:TooltipBehavior.java

示例15: renderHead

import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void renderHead(Component component, IHeaderResponse response) {
	super.renderHead(component, response);

	String script = String.format("gitplex.server.setupCollapse('%s', '%s')", component.getMarkupId(), target.getMarkupId());
	response.render(OnDomReadyHeaderItem.forScript(script));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:8,代码来源:CollapseBehavior.java


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