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


Java AjaxFallbackLink类代码示例

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


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

示例1: newLink

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
@Override
protected WebMarkupContainer newLink(final String linkId, final int index)
{
    return new AjaxFallbackLink<Void>(linkId)
    {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(final AjaxRequestTarget target)
        {
            setSelectedTab(index);
            onTabChange(index);
            if (target != null)
            {
                target.add(AjaxTabbedPanel.this);
            }
            onAjaxUpdate(target);
        }

    };
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:23,代码来源:AjaxTabbedPanel.java

示例2: initLayout

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private void initLayout(final IModel<TaskDto> taskDtoModel, final PageBase pageBase) {
	SortableDataProvider<OperationResult, String> provider = new ListDataProvider<>(this,
			new PropertyModel<List<OperationResult>>(taskDtoModel, TaskDto.F_OP_RESULT));
	TablePanel resultTablePanel = new TablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
	resultTablePanel.setStyle("padding-top: 0px;");
	resultTablePanel.setShowPaging(false);
	resultTablePanel.setOutputMarkupId(true);
	add(resultTablePanel);

	add(new AjaxFallbackLink(ID_SHOW_RESULT) {
		public void onClick(AjaxRequestTarget target) {
			OperationResult opResult = taskDtoModel.getObject().getTaskOperationResult();
			OperationResultPanel body = new OperationResultPanel(
					pageBase.getMainPopupBodyId(),
					new Model<>(OpResult.getOpResult(pageBase, opResult)),
					pageBase);
			body.setOutputMarkupId(true);
			pageBase.showMainPopup(body, target);
		}
	});
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:22,代码来源:TaskResultTabPanel.java

示例3: AjaxFallbackLinkLabel

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
public AjaxFallbackLinkLabel(String id, IModel<T> linkModel, IModel<?> contentModel, boolean indicator) {
    super(id);
    final Link link;
    if (indicator) {
        link = new IndicatingAjaxFallbackLink<T>("link", linkModel) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                AjaxFallbackLinkLabel.this.onClick(target);
            }
        };
    } else {
        link = new AjaxFallbackLink<T>("link", linkModel) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                AjaxFallbackLinkLabel.this.onClick(target);
            }
        };
    }
    add(link);

    link.add(new Label("content", contentModel));
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:25,代码来源:AjaxFallbackLinkLabel.java

示例4: createValuesView

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private DataView<FacetField.Count> createValuesView(String id) {
    final IModel<String> fieldNameModel = new PropertyModel<>(getModel(), "name");
    return new DataView<FacetField.Count>(id, valuesProvider, ITEMS_PER_PAGE) {

        @Override
        protected void populateItem(final Item<FacetField.Count> item) {
            item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));

            // link to select an individual facet value
            final Link selectLink = new AjaxFallbackLink("facetSelect") {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    // call callback
                    onValuesSelected(
                            // for now only single values can be selected
                    		Collections.singleton(item.getModelObject().getName()),
                            target);
                }
            };
            item.add(selectLink);

            // 'name' field from Count (name of value)
            selectLink.add(new FieldValueLabel("name", fieldNameModel));

            // 'count' field from Count (document count for value)
            item.add(new Label("count"));
        }
    };
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:31,代码来源:AllFacetValuesPanel.java

示例5: createQueryItem

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private Component createQueryItem(String id) {
    final Component query = new WebMarkupContainer(id)
            .add(new Label("label", new PropertyModel<String>(getModel(), "query")))
            .add(new AjaxFallbackLink<QueryFacetsSelection>("remove", getModel()) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    // get a copy of the current selection
                    final QueryFacetsSelection newSelection = getModelObject().getCopy();
                    newSelection.setQuery(null);
                    onSelectionChanged(newSelection, target);
                }
            });
    return query;
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:16,代码来源:SearchResultsHeaderPanel.java

示例6: createTitleToggler

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private void createTitleToggler() {
    // title is also a link that toggles expansion state
    final AjaxFallbackLink titleLink = new IndicatingAjaxFallbackLink("titleToggle") {

        @Override
        public void onClick(AjaxRequestTarget target) {
            final ExpansionState expansionState = expansionModel.getObject();
            if (expansionState == ExpansionState.COLLAPSED) {
                expansionModel.setObject(ExpansionState.EXPANDED);
            } else {
                expansionModel.setObject(ExpansionState.COLLAPSED);
            }
            if (target != null) {
                target.add(ExpandablePanel.this);
            }
        }
    };

    // Facet name becomes title
    titleLink.add(createTitleLabel("title"));
    titleLink.add(new AttributeModifier("aria-controls", ExpandablePanel.this.getMarkupId()));

    titleLink.add(new WebMarkupContainer("expand"));
    titleLink.add(new WebMarkupContainer("collapse"));
    titleLink.add(new Behavior() {
        @Override
        public void onConfigure(Component component) {
            final boolean expanded = expansionModel.getObject().equals(ExpansionState.EXPANDED);
            component.get("expand").setVisible(!expanded);
            component.get("collapse").setVisible(expanded);
        }

    });

    add(titleLink);
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:37,代码来源:ExpandablePanel.java

示例7: addEditButton

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private void addEditButton(final String id, final UserProfile userProfile) {
	AjaxFallbackLink editButton = new AjaxFallbackLink("editButton",
			new ResourceModel("button.edit")) {

		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			Component newPanel = new MyBusinessEdit(id, userProfile);
			newPanel.setOutputMarkupId(true);
			MyBusinessDisplay.this.replaceWith(newPanel);
			if (target != null) {
				target.add(newPanel);
				// resize iframe
				target.appendJavaScript("setMainFrameHeight(window.name);");
			}

		}

	};
	editButton.add(new Label("editButtonLabel", new ResourceModel(
			"button.edit")));
	editButton.setOutputMarkupId(true);

	if (userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
		editButton.setVisible(false);
	}

	add(editButton);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:30,代码来源:MyBusinessDisplay.java

示例8: IconWithClueTip

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
public IconWithClueTip(String id, String iconUrl, IModel textModel) {
	super(id);
		
	//tooltip text
	Label text = new Label("text", textModel);
	text.setOutputMarkupId(true);
	add(text);
	
	//we need to id of the text span so that we can map it to the link.
	//the cluetip functions automatically hide it for us.
	StringBuilder textId = new StringBuilder();
	textId.append("#");
	textId.append(text.getMarkupId());
	
	//link
	AjaxFallbackLink link = new AjaxFallbackLink("link") {
		public void onClick(AjaxRequestTarget target) {
			//nothing
		}
	};
	link.add(new AttributeModifier("rel", true, new Model(textId)));
	link.add(new AttributeModifier("href", true, new Model(textId)));
	
	//image
	ContextImage image = new ContextImage("icon",new Model(iconUrl));
	link.add(image);
	
	add(link);

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

示例9: TopicoStep

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
public TopicoStep(IDynamicWizardStep previous) {
	super(previous,"Escolha o Tópico","CLique no tópico a mover");
	setComplete(false);
	

	ListView<Topico> topicos = new ListView<Topico>("topicos",
			new ModeloListaTopicosDeForum(info.getIdComunidadeOrigem(), info.getIdForumOrigem())) {

		private static final long serialVersionUID = -5113198906301138306L;

		@Override
		protected void populateItem(final ListItem<Topico> item) {
			Link<Void> linkTopico = new AjaxFallbackLink<Void>(
					"link_topico") {

				private static final long serialVersionUID = 2729459814700718807L;

				@Override
				public void onClick(AjaxRequestTarget target) {
					info.setIdTopico(item.getModelObject().getId());
					info.setNomeTopico(item.getModelObject().getAssunto());
					setComplete(true);

				}
			};
			
			Label nomeTopico = new Label("nome_topico", item.getModelObject().toString());
			linkTopico.setOutputMarkupId(true);
			linkTopico.add(nomeTopico);
			item.add(linkTopico);

		}
	};
	topicos.setOutputMarkupId(true);
	add(topicos);

}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:38,代码来源:MoveTopicosWizard.java

示例10: ComunidadeDestinoStep

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
public ComunidadeDestinoStep(IDynamicWizardStep previousStep) {
	super(previousStep,"Escolha a Comunidade de Destino","Clique na comunidade para onde o tópico será movido");
	
	ListView<Group> comunidades = new ListView<Group>("comunidades",
			new ModeloListaComunidadesDestino(info.getIdUsuario(),info.getIdComunidadeOrigem())) {

		private static final long serialVersionUID = -5113198906301138306L;

		@Override
		protected void populateItem(final ListItem<Group> item) {
			Link<Void> linkComunidade = new AjaxFallbackLink<Void>(
					"link_comunidade") {

				private static final long serialVersionUID = 2729459814700718807L;

				@Override
				public void onClick(AjaxRequestTarget target) {
					Group comunidade = item.getModelObject();
					info.setIdComunidadeDestino(comunidade.getGroupId());
					info.setUrlComunidadeDestino(comunidade.getFriendlyURL());
					info.setNomeComunidadeDestino(comunidade.getName());
					setComplete(true);
				}
			};
			
			Label nomeComunidade = new Label("nome_comunidade", item.getModelObject().getName());
			linkComunidade.setOutputMarkupId(true);
			linkComunidade.add(nomeComunidade);
			item.add(linkComunidade);

		}
	};
	comunidades.setOutputMarkupId(true);
	add(comunidades);

	
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:38,代码来源:MoveTopicosWizard.java

示例11: readConsoleLogs

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
@Test
public void readConsoleLogs() {
    TESTER.assertComponent("body:content:tabbedPanel:tabs-container:tabs:1:link", AjaxFallbackLink.class);
    TESTER.clickLink("body:content:tabbedPanel:tabs-container:tabs:1:link");
    TESTER.assertComponent(CONTAINER_PATH, WebMarkupContainer.class);

    assertNotNull(searchLog(KEY, CONTAINER_PATH, "org.apache.syncope.fit"));
}
 
开发者ID:apache,项目名称:syncope,代码行数:9,代码来源:LogsITCase.java

示例12: getLink

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
@SuppressWarnings("serial")
	protected Link getLink() {
		Link link = new AjaxFallbackLink("link") {

			@Override
			public void onClick(AjaxRequestTarget target) {
				AbstractAjaxLinkPanel.this.onClick(target);
			}

		};
//		link.add(new SimpleAttributeModifier("class", "links"));
		link.add(new Label("label", getDisplayString()));

		return link;
	}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:16,代码来源:AbstractAjaxLinkPanel.java

示例13: initLayout

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private void initLayout(final IModel<TaskDto> taskDtoModel) {

		changesModel = new PropertyModel<>(taskDtoModel, TaskDto.F_CHANGE_BEING_APPROVED);
		TaskChangesPanel changesPanel = new TaskChangesPanel(ID_CHANGES, changesModel);
		changesPanel.setOutputMarkupId(true);
		add(changesPanel);

		final ItemApprovalHistoryPanel history = new ItemApprovalHistoryPanel(ID_HISTORY,
				new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_CONTEXT),
				UserProfileStorage.TableId.PAGE_TASK_HISTORY_PANEL,
				(int) parentPage.getItemsPerPage(UserProfileStorage.TableId.PAGE_TASK_HISTORY_PANEL));
		history.setOutputMarkupId(true);
		add(history);
		add(WebComponentUtil.createHelp(ID_HISTORY_HELP));

		WebMarkupContainer workItemsContainer = new WebMarkupContainer(ID_CURRENT_WORK_ITEMS_CONTAINER);
		final ISortableDataProvider<WorkItemDto, String> provider = new ListDataProvider(this, new PropertyModel<List<WorkItemDto>>(taskDtoModel, TaskDto.F_WORK_ITEMS));
		final WorkItemsPanel workItemsPanel = new WorkItemsPanel(ID_CURRENT_WORK_ITEMS, provider,
				UserProfileStorage.TableId.PAGE_TASK_CURRENT_WORK_ITEMS_PANEL,
				(int) parentPage.getItemsPerPage(UserProfileStorage.TableId.PAGE_TASK_CURRENT_WORK_ITEMS_PANEL),
				WorkItemsPanel.View.ITEMS_FOR_PROCESS);
		workItemsPanel.setOutputMarkupId(true);
		workItemsContainer.add(workItemsPanel);
		workItemsContainer.setOutputMarkupId(true);
		workItemsContainer.add(new VisibleEnableBehaviour() {
			@Override
			public boolean isVisible() {
				return provider.size() > 0;
			}
		});
		workItemsContainer.add(WebComponentUtil.createHelp(ID_CURRENT_WORK_ITEMS_HELP));
		add(workItemsContainer);

		final PropertyModel<List<ProcessInstanceDto>> relatedRequestsModel = new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_REQUESTS);

		WebMarkupContainer relatedRequestsContainer = new WebMarkupContainer(ID_RELATED_REQUESTS_CONTAINER);
		relatedRequestsContainer.add(new VisibleEnableBehaviour() {
			@Override
			public boolean isVisible() {
				return CollectionUtils.isNotEmpty(relatedRequestsModel.getObject());
			}
		});
		relatedRequestsContainer.setOutputMarkupId(true);
		add(relatedRequestsContainer);
		ISortableDataProvider<ProcessInstanceDto, String> requestsProvider = new ListDataProvider(this, relatedRequestsModel);
		relatedRequestsContainer.add(new ProcessInstancesPanel(ID_RELATED_REQUESTS, requestsProvider, null, 10,
				ProcessInstancesPanel.View.TASKS_FOR_PROCESS, null));
		relatedRequestsContainer.add(WebComponentUtil.createHelp(ID_RELATED_REQUESTS_HELP));

		IModel<String> taskOidModel = new PropertyModel<>(taskDtoModel, TaskDto.F_OID);
		IModel<Boolean> showNextStagesModel = new PropertyModel<>(taskDtoModel, TaskDto.F_IN_STAGE_BEFORE_LAST_ONE);
		add(new SwitchableApprovalProcessPreviewsPanel(ID_PREVIEWS_PANEL, taskOidModel, showNextStagesModel, parentPage));
		add(new AjaxFallbackLink(ID_SHOW_PARENT) {
			public void onClick(AjaxRequestTarget target) {
				String oid = taskDtoModel.getObject().getParentTaskOid();
				if (oid != null) {
					PageParameters parameters = new PageParameters();
					parameters.add(OnePageParameterEncoder.PARAMETER, oid);
					((PageBase) getPage()).navigateToNext(PageTaskEdit.class, parameters);
				}
			}
		});
		add(WebComponentUtil.createHelp(ID_SHOW_PARENT_HELP));
	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:65,代码来源:TaskWfChildPanel.java

示例14: addComponents

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
private void addComponents(PageParameters params) {
    // Navigation
    add(createNavigation("recordNavigation"));

    final WebMarkupContainer topNavigation = new WebMarkupContainer("navigation");
    add(topNavigation
            .add(new BreadCrumbPanel("breadcrumbs", selectionModel, getModel()))
            .add(createPermalink("permalink", topNavigation))
            .add(new Link("backToSearch") {
                @Override
                public void onClick() {
                    setResponsePage(new FacetedSearchPage(selectionModel));
                }
            })
            .setOutputMarkupId(true)
    );

    // General information section
    add(new SolrFieldLabel("name", getModel(), FacetConstants.FIELD_NAME, getString("recordpage.unnamedrecord")));
    add(createLandingPageLink("landingPageLink"));

    tabs = createTabs("tabs");
    final StringValue initialTab = params.get(VloWebAppParameters.RECORD_PAGE_TAB);
    if (!initialTab.isEmpty()) {
        final int tabIndex = TABS_ORDER.indexOf(initialTab.toString());
        if (tabIndex >= 0) {
            tabs.setSelectedTab(tabIndex);
        }
    }
    add(tabs);

    add(createSearchLinks("searchlinks"));
    //define the order for availability values
    final Ordering<String> availabilityOrdering = new PreferredExplicitOrdering(
            //extract the 'primary' availability values from the configuration
            FieldValueDescriptor.valuesList(config.getAvailabilityValues()));
    add(new SearchResultItemLicensePanel("licenseInfo", getModel(), navigationModel, availabilityOrdering) {
        @Override
        protected WebMarkupContainer createLink(String id) {
            return new AjaxFallbackLink(id) {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    tabs.setSelectedTab(TABS_ORDER.indexOf(AVAILABILITY_SECTION));
                    if (target != null) {
                        target.add(tabs);
                    }
                }
            };
        }

    });
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:53,代码来源:RecordPage.java

示例15: MyStudentDisplay

import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入依赖的package包/类
public MyStudentDisplay(final String id, final UserProfile userProfile) {
	
	super(id);
	
	//heading
	add(new Label("heading", new ResourceModel("heading.student")));
	
	String course = userProfile.getCourse();
	String subjects = userProfile.getSubjects();
	
	int visibleFieldCount = 0;
	
	//course
	WebMarkupContainer courseContainer = new WebMarkupContainer("courseContainer");
	courseContainer.add(new Label("courseLabel", new ResourceModel("profile.course")));
	courseContainer.add(new Label("course", course));
	add(courseContainer);
	if(StringUtils.isBlank(course)) {
		courseContainer.setVisible(false);
	} else {
		visibleFieldCount++;
	}
	
	//subjects
	WebMarkupContainer subjectsContainer = new WebMarkupContainer("subjectsContainer");
	subjectsContainer.add(new Label("subjectsLabel", new ResourceModel("profile.subjects")));
	subjectsContainer.add(new Label("subjects", subjects));
	add(subjectsContainer);
	if(StringUtils.isBlank(subjects)) {
		subjectsContainer.setVisible(false);
	} else {
		visibleFieldCount++;
	}

	//edit button
	AjaxFallbackLink editButton = new AjaxFallbackLink("editButton", new ResourceModel("button.edit")) {
		
		private static final long serialVersionUID = 1L;

		public void onClick(AjaxRequestTarget target) {
			Component newPanel = new MyStudentEdit(id, userProfile);
			newPanel.setOutputMarkupId(true);
			MyStudentDisplay.this.replaceWith(newPanel);
			if(target != null) {
				target.add(newPanel);
				//resize iframe
				target.appendJavaScript("setMainFrameHeight(window.name);");
			}
			
		}
					
	};
	editButton.add(new Label("editButtonLabel", new ResourceModel("button.edit")));
	editButton.setOutputMarkupId(true);
	
	if(userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
		editButton.setVisible(false);
	}
	
	add(editButton);
	
	//no fields message
	Label noFieldsMessage = new Label("noFieldsMessage", new ResourceModel("text.no.fields"));
	add(noFieldsMessage);
	if(visibleFieldCount > 0) {
		noFieldsMessage.setVisible(false);
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:69,代码来源:MyStudentDisplay.java


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