• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java StatelessLink类的典型用法和代码示例

java 1次浏览

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

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

示例1: buildSelectSkinLink

点赞 2

import org.apache.wicket.markup.html.link.StatelessLink; //导入依赖的package包/类
private StatelessLink buildSelectSkinLink(final Skin skin) {
    return new StatelessLink("change_action") {
        @Override
        public void onClick() {
            option.selectSkin(skin);
            refreshPage();
        }
    };
}
 

开发者ID:opensingular,
项目名称:singular-server,
代码行数:10,
代码来源:TopMenu.java

示例2: commonInit

点赞 2

import org.apache.wicket.markup.html.link.StatelessLink; //导入依赖的package包/类
@SuppressWarnings("serial")
private void commonInit()
{
    add(new Label("username").setDefaultModel(new Model<>(SecurityContextHolder
            .getContext().getAuthentication().getName())));

    add(new StatelessLink<Void>("logout")
    {
        @Override
        public void onClick()
        {
            AuthenticatedWebSession.get().signOut();
            getSession().invalidate();
            setResponsePage(getApplication().getHomePage());
        }
    });
    
    add(new MarkupContainer("logoutTimer")
    {
        @Override
        protected void onConfigure()
        {
            super.onConfigure();
            setVisible(getAutoLogoutTime() > 0);
        }
    });
}
 

开发者ID:webanno,
项目名称:webanno,
代码行数:28,
代码来源:LogoutPanel.java

示例3: MainMenuPage

点赞 2

import org.apache.wicket.markup.html.link.StatelessLink; //导入依赖的package包/类
public MainMenuPage()
{
    setStatelessHint(true);
    setVersioned(false);
    
    // In case we restore a saved session, make sure the user actually still exists in the DB.
    // redirect to login page (if no usr is found, admin/admin will be created)
    User user = userRepository.getCurrentUser();
    if (user == null) {
        setResponsePage(LoginPage.class);
    }
    
    // if not either a curator or annotator, display warning message
    if (
            !annotationEnabeled(projectService, user, WebAnnoConst.PROJECT_TYPE_ANNOTATION)
            && !annotationEnabeled(projectService, user, WebAnnoConst.PROJECT_TYPE_AUTOMATION)
            && !annotationEnabeled(projectService, user, WebAnnoConst.PROJECT_TYPE_CORRECTION)
            && !curationEnabeled(projectService, user)) 
    {
        warn("You are not member of any projects to annotate or curate.");
    }
    
    menu = new ListView<MenuItem>("menu", LambdaModel.of(menuItemService::getMenuItems))
    {
        private static final long serialVersionUID = -5492972164756003552L;

        @Override
        protected void populateItem(ListItem<MenuItem> aItem)
        {
            MenuItem item = aItem.getModelObject();
            StatelessLink<Void> menulink = new StatelessLink<Void>("menulink") {
                private static final long serialVersionUID = 4110674757822252390L;

                @Override
                public void onClick()
                {
                    setResponsePage(item.getPageClass());
                }
            };
            menulink.add(
                    new Image("icon", new UrlResourceReference(Url.parse(item.getIcon()))));
            menulink.add(new Label("label", PropertyModel.of(item, "label")));
            menulink.setVisible(item.applies());
            aItem.add(menulink);
        }
    };
    add(menu);
}
 

开发者ID:webanno,
项目名称:webanno,
代码行数:49,
代码来源:MainMenuPage.java

示例4: SignOutPanel

点赞 2

import org.apache.wicket.markup.html.link.StatelessLink; //导入依赖的package包/类
public SignOutPanel(String id) {
    super(id);

    add(new Label("authCount", new LoadableDetachableModel<Integer>() {
        private static final long serialVersionUID = 1L;
        @Override
        protected Integer load() {
            return authentications.getObject().size();
        }
    }));
    add(new ListView<AuthenticationData>("authentications", authentications) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<AuthenticationData> item) {
            Link<AuthenticationData> signOut;
            item.add(signOut = new Link<AuthenticationData>("signOut", item.getModel()) {
                private static final long serialVersionUID = 1L;
                @Override
                public void onClick() {

                    String username = getModelObject().getUsername();
                    String cluster = getModelObject().getCluster();

                    if (EtcdWebSession.get().signOut(cluster, username)) {
                        info("Successfully signed out user: " + username + " from: " + cluster);
                    } else {
                        error("Failed to sign out user: " + username + " from: " + cluster);
                    }

                    setResponsePage(getPage().getPageClass(), getPage().getPageParameters());
                }
            });

            signOut.add(new Label("username", new PropertyModel<>(item.getModel(), "username")));

            signOut.add(new Label("cluster", new PropertyModel<String>(item.getModel(), "cluster")));

        }
    });

    add(new StatelessLink<Void>("signOutAll") {
        private static final long serialVersionUID = 1L;
        @Override
        public void onClick() {
            EtcdWebSession.get().invalidate();
            setResponsePage(Application.get().getHomePage());
        }
    });
}
 

开发者ID:nikfoundas,
项目名称:etcd-viewer,
代码行数:51,
代码来源:SignOutPanel.java

示例5: renderTable

点赞 2

import org.apache.wicket.markup.html.link.StatelessLink; //导入依赖的package包/类
private void renderTable() {
	tableTd = new WebMarkupContainer("tableTd");
	createTable();
	if(!renderTable) {
		tableTd.setVisible(false);
	}else if(renderTable && !renderChart) {
		tableTd.add(AttributeModifier.replace("colspan", "2"));
	}
	tableLink = new StatelessLink("link") {
		private static final long	serialVersionUID	= 1L;
		@Override
		public void onClick() {
			ReportDef rd = null;
			if(useChartReportDefinitionForTable()) {
				rd = getChartReportDefinition();
			}else{
				rd = getTableReportDefinition();
			}
			String siteId = rd.getSiteId();
			ReportDefModel reportDefModel = new ReportDefModel(rd);
			setResponsePage(new ReportDataPage(reportDefModel, new PageParameters().set("siteId", siteId), getWebPage()));
		}					
	};
	tableLink.setOutputMarkupId(true);
	tableTd.add(tableLink);
	
	tableJs = new WebMarkupContainer("tableJs") {
		private static final long	serialVersionUID	= 1L;
		@Override
		public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
			StringBuilder js = new StringBuilder();
			js.append("jQuery('#");
			js.append(table.getMarkupId());
			js.append("').fadeIn();");
			js.append("jQuery('#");
			js.append(tableLink.getMarkupId());
			js.append("').fadeIn();");
			replaceComponentTagBody(markupStream, openTag, js.toString());
		}
	};
	tableJs.setOutputMarkupId(true);
	tableTd.add(tableJs);
	
	tableTd.setOutputMarkupId(true);
	add(tableTd);
}
 

开发者ID:sakaiproject,
项目名称:sakai,
代码行数:47,
代码来源:WidgetTabTemplate.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)