org.apache.wicket.extensions.markup.html.tabs.ITab Java Examples

The following examples show how to use org.apache.wicket.extensions.markup.html.tabs.ITab. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InstancePanel.java    From inception with Apache License 2.0 6 votes vote down vote up
private List<ITab> makeTabs()
{
    List<ITab> tabs = new ArrayList<>();
            
    tabs.add(new AbstractTab(Model.of("Mentions"))
    {
        private static final long serialVersionUID = 6703144434578403272L;

        @Override
        public Panel getPanel(String panelId)
        {
            if (selectedInstanceHandle.getObject() != null) {
                return new AnnotatedListIdentifiers(panelId, kbModel, selectedConceptHandle,
                        selectedInstanceHandle, true);
            }
            else {
                return new EmptyPanel(panelId);
            }
        }
    });        
    return tabs;
}
 
Example #2
Source File: SCIMConfUserPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
private <T extends Enum<?>> void buildComplexAccordion(
        final SCIMComplexConf<T> complex,
        final String basePanelId,
        final String baseTabId,
        final T canonicalType) {

    Accordion accordion = new Accordion(basePanelId + '_' + complex.getType().name(),
            Collections.<ITab>singletonList(new AbstractTab(Model.of(baseTabId + '.' + complex.getType().name())) {

                private static final long serialVersionUID = -5861786415855103549L;

                @Override
                public WebMarkupContainer getPanel(final String panelId) {
                    return buildComplexAccordionContent(complex, canonicalType, panelId);
                }

            }), Model.of(-1)); // accordion closed at beginning
    add(accordion.setOutputMarkupId(true));
}
 
Example #3
Source File: RoleWizardBuilder.java    From syncope with Apache License 2.0 6 votes vote down vote up
public Details(final RoleWrapper modelObject) {
    add(new AjaxTextFieldPanel(
            Constants.KEY_FIELD_NAME,
            Constants.KEY_FIELD_NAME,
            new PropertyModel<>(modelObject.getInnerObject(), Constants.KEY_FIELD_NAME), false).
            setEnabled(StringUtils.isEmpty(modelObject.getInnerObject().getKey())));

    // ------------------------
    // dynMembershipCond
    // ------------------------
    add(new Accordion("dynMembershipCond", Collections.<ITab>singletonList(
            new AbstractTab(new ResourceModel("dynMembershipCond", "Dynamic USER Membership Conditions")) {

        private static final long serialVersionUID = 1037272333056449378L;

        @Override
        public Panel getPanel(final String panelId) {
            return new UserSearchPanel.Builder(
                    new PropertyModel<>(modelObject, "dynClauses")).
                    required(true).build(panelId);
        }
    }), Model.of(StringUtils.isBlank(modelObject.getDynMembershipCond()) ? -1 : 0)).setOutputMarkupId(true));
    // ------------------------
}
 
Example #4
Source File: Realm.java    From syncope with Apache License 2.0 6 votes vote down vote up
public Realm(final String id, final RealmTO realmTO, final PageReference pageRef, final int selectedIndex) {
    super(id, true);
    this.realmTO = realmTO;
    this.anyTypes = AnyTypeRestClient.listAnyTypes();

    setPageRef(pageRef);

    AjaxBootstrapTabbedPanel<ITab> tabbedPanel =
            new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList(pageRef));
    tabbedPanel.setSelectedTab(selectedIndex);
    addInnerObject(tabbedPanel);
    this.wizardBuilder = new RealmWizardBuilder(pageRef);
    addNewItemPanelBuilder(this.wizardBuilder, false);

    setShowResultPage(true);

    modal.size(Modal.Size.Large);
    setWindowClosedReloadCallback(modal);
}
 
Example #5
Source File: SchemasPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
private List<ITab> buildTabList() {
    List<ITab> tabs = new ArrayList<>();

    for (final SchemaType schemaType : SchemaType.values()) {
        tabs.add(new AbstractTab(new Model<>(schemaType.name())) {

            private static final long serialVersionUID = 1037272333056449378L;

            @Override
            public Panel getPanel(final String panelId) {
                return new SchemaTypePanel(panelId, schemaType, pageRef);
            }
        });
    }

    return tabs;
}
 
Example #6
Source File: ConceptInstancePanel.java    From inception with Apache License 2.0 6 votes vote down vote up
public ConceptInstancePanel(String aId, IModel<KnowledgeBase> aKbModel,
        IModel<KBObject> aSelectedConceptHandle, IModel<KBConcept> aSelectedConceptModel)
{
    super(aId, aSelectedConceptModel);
    setOutputMarkupId(true);
    kbModel = aKbModel;
    selectedInstanceHandle = Model.of();
    selectedConceptHandle = aSelectedConceptHandle;
    
    add(new BootstrapAjaxTabbedPanel<ITab>("tabPanel", makeTabs()));
    
    add(new ConceptInfoPanel("info", kbModel, aSelectedConceptHandle, aSelectedConceptModel));
            
    instanceInfoPanel = new EmptyPanel(INSTANCE_INFO_MARKUP_ID).setVisibilityAllowed(false);
    add(instanceInfoPanel);
}
 
Example #7
Source File: SRA.java    From syncope with Apache License 2.0 5 votes vote down vote up
public SRA(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    AjaxBootstrapTabbedPanel<ITab> tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList());
    content.add(tabbedPanel);

    body.add(content);
}
 
Example #8
Source File: ImageTabbedPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
@Override
protected WebMarkupContainer newLink(String linkId, final int index) {
	List<? extends ITab> tabs = getTabs();
	
	// check for usage of our custom class, if it is not our class, 
	// add as image empty container - this way you can use image only in tabs you want
	ITab currentTab = tabs.get(index);
	if (currentTab instanceof ImageTab) {
		ImageTab imageTab = (ImageTab) currentTab;
		return new ImageTabLink(linkId, imageTab.getImage()) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				setSelectedTab(index);
				if (target != null) {
					target.add(ImageTabbedPanel.this);
				}
				onAjaxUpdate(target);
			}
			
		};
	} else {
		WebMarkupContainer link = super.newLink(linkId, index);
		link.add(new WebMarkupContainer("image").setVisible(false));			
		
		return link;
	}
}
 
Example #9
Source File: ConfigPage.java    From oodt with Apache License 2.0 5 votes vote down vote up
private int getTabIdx(List<ITab> tabs, String tabName) {
  for (int i = 0; i < tabs.size(); i++) {
    ITab tab = tabs.get(i);
    if (tab.getTitle().getObject().equals(tabName)) {
      return i;
    }
  }

  return -1;
}
 
Example #10
Source File: SCIMConfEnterpriseUserPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
private void buildManagerAccordion() {
    final Accordion accordion = new Accordion("managerAccordion",
            Collections.<ITab>singletonList(new AbstractTab(Model.of("manager")) {

                private static final long serialVersionUID = -5861786415855103549L;

                @Override
                public WebMarkupContainer getPanel(final String panelId) {
                    return buildNameAccordionContent(panelId);
                }

            }), Model.of(-1)); // accordion closed at beginning
    add(accordion.setOutputMarkupId(true));

}
 
Example #11
Source File: SCIMConfPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
public SCIMConfPanel(
        final String id,
        final SCIMConf scimConfTO,
        final PageReference pageRef) {
    super(id, true);

    this.scimConfTO = scimConfTO;
    this.pageRef = pageRef;

    setPageRef(pageRef);

    AjaxBootstrapTabbedPanel<ITab> tabbedPanel =
            new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList());
    tabbedPanel.setSelectedTab(0);
    addInnerObject(tabbedPanel);

    AjaxLink<String> saveButton = new AjaxLink<String>("saveButton") {

        private static final long serialVersionUID = -7978723352517770644L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            SCIMConfRestClient.set(SCIMConfPanel.this.scimConfTO);
        }
    };
    addInnerObject(saveButton);

    setShowResultPage(true);

    modal.size(Modal.Size.Large);
    setWindowClosedReloadCallback(modal);
}
 
Example #12
Source File: InstancePanel.java    From inception with Apache License 2.0 5 votes vote down vote up
public InstancePanel(String aId, IModel<KnowledgeBase> aKbModel,
        IModel<KBObject> aSelectedConceptHandle, IModel<KBObject> aSelectedInstanceHandle,
        IModel<KBInstance> aSelectedInstanceModel)
{
    super(aId, aSelectedInstanceModel);
    setOutputMarkupId(true);
    kbModel = aKbModel;
    selectedInstanceHandle = aSelectedInstanceHandle;
    selectedConceptHandle = aSelectedConceptHandle;
    
    addOrReplace(new InstanceInfoPanel("instanceinfo", aKbModel, selectedInstanceHandle,
            aSelectedInstanceModel));

    add(new BootstrapAjaxTabbedPanel<ITab>("tabPanel", makeTabs()));
}
 
Example #13
Source File: SCIMConfUserPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
private void buildAddressAccordion(final SCIMUserAddressConf address, final AddressCanonicalType canonicalType) {
    Accordion accordion = new Accordion("addressesAccordion_" + address.getType().name(),
            Collections.<ITab>singletonList(new AbstractTab(Model.of("address." + address.getType().name())) {

                private static final long serialVersionUID = -5861786415855103549L;

                @Override
                public WebMarkupContainer getPanel(final String panelId) {
                    return buildAddressAccordionContent(address, canonicalType, panelId);
                }

            }), Model.of(-1)); // accordion closed at beginning
    add(accordion.setOutputMarkupId(true));
}
 
Example #14
Source File: SCIMConfUserPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
private void buildNameAccordion() {
    final Accordion accordion = new Accordion("nameAccordion",
            Collections.<ITab>singletonList(new AbstractTab(Model.of("name")) {

                private static final long serialVersionUID = -5861786415855103549L;

                @Override
                public WebMarkupContainer getPanel(final String panelId) {
                    return buildNameAccordionContent(panelId);
                }

            }), Model.of(-1)); // accordion closed at beginning
    add(accordion.setOutputMarkupId(true));
}
 
Example #15
Source File: CamelRoutes.java    From syncope with Apache License 2.0 5 votes vote down vote up
public CamelRoutes(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    AjaxBootstrapTabbedPanel<ITab> tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList());
    content.add(tabbedPanel);

    MetaDataRoleAuthorizationStrategy.authorize(content, ENABLE, CamelEntitlement.ROUTE_LIST);
    body.add(content);
}
 
Example #16
Source File: NetworkServices.java    From syncope with Apache License 2.0 5 votes vote down vote up
private List<ITab> buildTabList() {
    return Stream.of(NetworkService.Type.values()).
            sorted().
            map(type -> new AbstractTab(Model.of(type.name())) {

        private static final long serialVersionUID = -5861786415855103549L;

        @Override
        public WebMarkupContainer getPanel(final String panelId) {
            return new NetworkServiceDirectoryPanel(panelId, type, getPageReference());
        }
    }).collect(Collectors.toList());
}
 
Example #17
Source File: Implementations.java    From syncope with Apache License 2.0 5 votes vote down vote up
private List<ITab> buildTabList() {
    return SyncopeConsoleSession.get().getPlatformInfo().getImplementationTypes().stream().
            filter(type -> !IdRepoImplementationType.JWT_SSO_PROVIDER.equals(type)
            && !IdRepoImplementationType.AUDIT_APPENDER.equals(type)).
            sorted().
            map(type -> new AbstractTab(Model.of(type)) {

        private static final long serialVersionUID = -5861786415855103549L;

        @Override
        public WebMarkupContainer getPanel(final String panelId) {
            return new ImplementationDirectoryPanel(panelId, type, getPageReference());
        }
    }).collect(Collectors.toList());
}
 
Example #18
Source File: PushTaskFilters.java    From syncope with Apache License 2.0 5 votes vote down vote up
public PushTaskFilters(final PushTaskWrapper pushTaskWrapper) {
    super();

    final LoadableDetachableModel<List<AnyTypeTO>> types = new LoadableDetachableModel<List<AnyTypeTO>>() {

        private static final long serialVersionUID = 5275935387613157437L;

        @Override
        protected List<AnyTypeTO> load() {
            return AnyTypeRestClient.listAnyTypes();
        }
    };

    add(new ListView<AnyTypeTO>("filters", types) {

        private static final long serialVersionUID = 9101744072914090143L;

        @Override
        protected void populateItem(final ListItem<AnyTypeTO> item) {
            final String key = item.getModelObject().getKey();
            item.add(new Accordion("filters", Collections.<ITab>singletonList(
                    new AbstractTab(new StringResourceModel(
                            "filters", this, new Model<>(item.getModelObject()))) {

                private static final long serialVersionUID = 1037272333056449378L;

                @Override
                public Panel getPanel(final String panelId) {
                    return new AnyObjectSearchPanel.Builder(
                            key, new MapOfListModel<>(pushTaskWrapper, "filterClauses", key)).
                            required(false).build(panelId);
                }
            }), Model.of(StringUtils.isBlank(pushTaskWrapper.getFilters().get(key)) ? -1 : 0))
                    .setOutputMarkupId(true));
        }
    });
}
 
Example #19
Source File: ViewBusiness.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public ViewBusiness(String id, String userUuid, SakaiPerson sakaiPerson,
		boolean isBusinessInfoAllowed) {

	super(id);

	WebMarkupContainer businessInfoContainer = new WebMarkupContainer(
			"mainSectionContainer_business");
	businessInfoContainer.setOutputMarkupId(true);
	businessInfoContainer.add(new Label("mainSectionHeading_business",
			new ResourceModel("heading.business")));
	add(businessInfoContainer);

	WebMarkupContainer businessBiographyContainer = new WebMarkupContainer(
			"businessBiographyContainer");

	businessBiographyContainer.add(new Label("businessBiographyLabel",
			new ResourceModel("profile.business.bio")));
	businessBiographyContainer.add(new Label("businessBiography",
			sakaiPerson.getBusinessBiography()));

	businessInfoContainer.add(businessBiographyContainer);

	if (StringUtils.isBlank(sakaiPerson.getBusinessBiography())) {
		businessBiographyContainer.setVisible(false);
	} else {
		visibleFieldCount_business++;
	}

	WebMarkupContainer companyProfilesContainer = new WebMarkupContainer(
			"companyProfilesContainer");

	companyProfilesContainer.add(new Label("companyProfilesLabel",
			new ResourceModel("profile.business.company.profiles")));

	List<CompanyProfile> companyProfiles = profileLogic.getCompanyProfiles(userUuid);

	List<ITab> tabs = new ArrayList<ITab>();
	if (null != companyProfiles) {

		for (final CompanyProfile companyProfile : companyProfiles) {

			visibleFieldCount_business++;

			tabs.add(new AbstractTab(new ResourceModel(
					"profile.business.company.profile")) {

				private static final long serialVersionUID = 1L;

				@Override
				public Panel getPanel(String panelId) {

					return new CompanyProfileDisplay(panelId,
							companyProfile);
				}

			});
		}
	}

	companyProfilesContainer.add(new AjaxTabbedPanel("companyProfiles", tabs));
	businessInfoContainer.add(companyProfilesContainer);

	if (0 == tabs.size()) {
		companyProfilesContainer.setVisible(false);
	}

	// if nothing/not allowed, hide whole panel
	if (visibleFieldCount_business == 0 || !isBusinessInfoAllowed) {
		businessInfoContainer.setVisible(false);
	}
}
 
Example #20
Source File: AnyPanel.java    From syncope with Apache License 2.0 4 votes vote down vote up
public AnyPanel(
        final String id,
        final AnyTypeTO anyTypeTO,
        final RealmTO realmTO,
        final AnyLayout anyLayout,
        final boolean enableSearch,
        final DirectoryPanelSupplier directoryPanelSupplier,
        final PageReference pageRef) {

    super(id);
    this.anyTypeTO = anyTypeTO;
    this.realmTO = realmTO;
    this.anyLayout = anyLayout;
    this.pageRef = pageRef;
    // ------------------------
    // Accordion
    // ------------------------
    Model<Integer> model = Model.of(-1);
    Accordion accordion = new Accordion("accordionPanel",
            List.of(new AbstractTab(new ResourceModel("search.result")) {

                protected static final long serialVersionUID = 1037272333056449377L;

                @Override
                public WebMarkupContainer getPanel(final String panelId) {
                    searchPanel = getSearchPanel(panelId);
                    return searchPanel;
                }

            }), model) {

        protected static final long serialVersionUID = -3056452800492734900L;

        @Override
        protected Component newTitle(final String markupId, final ITab tab, final Accordion.State state) {
            return new AjaxLink<Integer>(markupId) {

                protected static final long serialVersionUID = 6250423506463465679L;

                @Override
                public void onClick(final AjaxRequestTarget target) {
                    model.setObject(model.getObject() == 0 ? -1 : 0);
                }
            }.setBody(tab.getTitle()).setEscapeModelStrings(false);
        }
    };
    accordion.setOutputMarkupId(true);
    add(accordion.setEnabled(enableSearch).setVisible(enableSearch));

    directoryPanel = createDirectoryPanel(anyTypeTO, realmTO, anyLayout, enableSearch, directoryPanelSupplier);
    add(directoryPanel);
    // ------------------------
}
 
Example #21
Source File: ImageTabbedPanel.java    From nextreports-server with Apache License 2.0 4 votes vote down vote up
public ImageTabbedPanel(String id, List<ITab> tabs) {
	super(id, tabs);
	afterInit();
}
 
Example #22
Source File: MyBusinessEdit.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
private WebMarkupContainer createCompanyProfileEditsContainer(
		final UserProfile userProfile, TabDisplay tabDisplay) {

	WebMarkupContainer companyProfilesContainer = new WebMarkupContainer(
			"companyProfilesContainer");

	companyProfilesContainer.add(new Label("companyProfilesLabel",
			new ResourceModel("profile.business.company.profiles")));

	List<ITab> tabs = new ArrayList<ITab>();
	if (null != userProfile.getCompanyProfiles()) {

		for (final CompanyProfile companyProfile : userProfile
				.getCompanyProfiles()) {

			tabs.add(new AbstractTab(new ResourceModel("profile.business.company.profile")) {

				private static final long serialVersionUID = 1L;

				@Override
				public Panel getPanel(String panelId) {

					return new CompanyProfileEdit(panelId, companyProfile);
				}

			});
		}
	}

	companyProfileTabs = new AjaxTabbedPanel("companyProfiles", tabs);
	companyProfilesContainer.add(companyProfileTabs);

	if (tabs.size() > 0) {
		switch (tabDisplay) {
		case START:
			companyProfileTabs.setSelectedTab(0);
			break;
		case END:
			companyProfileTabs.setSelectedTab(tabs.size() - 1);
		}
	} else {
		companyProfilesContainer.setVisible(false);
	}

	return companyProfilesContainer;
}
 
Example #23
Source File: MyBusinessEdit.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
private WebMarkupContainer createCompanyProfileEditsContainer(
		final UserProfile userProfile, TabDisplay tabDisplay) {

	WebMarkupContainer companyProfilesContainer = new WebMarkupContainer(
			"companyProfilesContainer");

	companyProfilesContainer.add(new Label("companyProfilesLabel",
			new ResourceModel("profile.business.company.profiles")));

	List<ITab> tabs = new ArrayList<ITab>();
	if (null != userProfile.getCompanyProfiles()) {

		for (final CompanyProfile companyProfile : userProfile
				.getCompanyProfiles()) {

			tabs.add(new AbstractTab(new ResourceModel("profile.business.company.profile")) {

				private static final long serialVersionUID = 1L;

				@Override
				public Panel getPanel(String panelId) {

					return new CompanyProfileEdit(panelId, companyProfile);
				}

			});
		}
	}

	companyProfileTabs = new AjaxTabbedPanel("companyProfiles", tabs);
	companyProfilesContainer.add(companyProfileTabs);

	if (tabs.size() > 0) {
		switch (tabDisplay) {
		case START:
			companyProfileTabs.setSelectedTab(0);
			break;
		case END:
			companyProfileTabs.setSelectedTab(tabs.size() - 1);
		}
	} else {
		companyProfilesContainer.setVisible(false);
	}

	return companyProfilesContainer;
}
 
Example #24
Source File: ViewBusiness.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public ViewBusiness(String id, String userUuid, SakaiPerson sakaiPerson,
		boolean isBusinessInfoAllowed) {

	super(id);

	WebMarkupContainer businessInfoContainer = new WebMarkupContainer(
			"mainSectionContainer_business");
	businessInfoContainer.setOutputMarkupId(true);
	businessInfoContainer.add(new Label("mainSectionHeading_business",
			new ResourceModel("heading.business")));
	add(businessInfoContainer);

	WebMarkupContainer businessBiographyContainer = new WebMarkupContainer(
			"businessBiographyContainer");

	businessBiographyContainer.add(new Label("businessBiographyLabel",
			new ResourceModel("profile.business.bio")));
	businessBiographyContainer.add(new Label("businessBiography",
			sakaiPerson.getBusinessBiography()));

	businessInfoContainer.add(businessBiographyContainer);

	if (StringUtils.isBlank(sakaiPerson.getBusinessBiography())) {
		businessBiographyContainer.setVisible(false);
	} else {
		visibleFieldCount_business++;
	}

	WebMarkupContainer companyProfilesContainer = new WebMarkupContainer(
			"companyProfilesContainer");

	companyProfilesContainer.add(new Label("companyProfilesLabel",
			new ResourceModel("profile.business.company.profiles")));

	List<CompanyProfile> companyProfiles = profileLogic.getCompanyProfiles(userUuid);

	List<ITab> tabs = new ArrayList<ITab>();
	if (null != companyProfiles) {

		for (final CompanyProfile companyProfile : companyProfiles) {

			visibleFieldCount_business++;

			tabs.add(new AbstractTab(new ResourceModel(
					"profile.business.company.profile")) {

				private static final long serialVersionUID = 1L;

				@Override
				public Panel getPanel(String panelId) {

					return new CompanyProfileDisplay(panelId,
							companyProfile);
				}

			});
		}
	}

	companyProfilesContainer.add(new AjaxTabbedPanel("companyProfiles", tabs));
	businessInfoContainer.add(companyProfilesContainer);

	if (0 == tabs.size()) {
		companyProfilesContainer.setVisible(false);
	}

	// if nothing/not allowed, hide whole panel
	if (visibleFieldCount_business == 0 || !isBusinessInfoAllowed) {
		businessInfoContainer.setVisible(false);
	}
}
 
Example #25
Source File: MyBusinessDisplay.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
private int addCompanyProfiles(final UserProfile userProfile,
		int visibleFieldCount) {
	
	WebMarkupContainer companyProfilesContainer = new WebMarkupContainer(
			"companyProfilesContainer");

	companyProfilesContainer.add(new Label("companyProfilesLabel",
			new ResourceModel("profile.business.company.profiles")));
	
	List<ITab> tabs = new ArrayList<ITab>();

	if (null != userProfile.getCompanyProfiles()) {

		for (final CompanyProfile companyProfile : userProfile
				.getCompanyProfiles()) {

			tabs.add(new AbstractTab(new ResourceModel("profile.business.company.profile")) {

				private static final long serialVersionUID = 1L;

				@Override
				public Panel getPanel(String panelId) {

					return new CompanyProfileDisplay(panelId, companyProfile);
				}

			});
		}
	}

	companyProfilesContainer.add(new AjaxTabbedPanel("companyProfiles", tabs));
	add(companyProfilesContainer);
	
	if (0 == tabs.size()) {			
		companyProfilesContainer.setVisible(false);
	} else {
		visibleFieldCount++;
	}

	return visibleFieldCount;
}
 
Example #26
Source File: Accordion.java    From syncope with Apache License 2.0 4 votes vote down vote up
public Accordion(final String markupId, final List<ITab> tabs) {
    super(markupId, tabs);
}
 
Example #27
Source File: Accordion.java    From syncope with Apache License 2.0 4 votes vote down vote up
public Accordion(final String markupId, final List<ITab> tabs, final IModel<Integer> activeTab) {
    super(markupId, tabs, activeTab);
}
 
Example #28
Source File: OIDCClient.java    From syncope with Apache License 2.0 4 votes vote down vote up
private List<ITab> buildTabList() {

        final List<ITab> tabs = new ArrayList<>(1);

        tabs.add(new AbstractTab(new ResourceModel("op")) {
            private static final long serialVersionUID = -6815067322125799251L;


            @Override
            public Panel getPanel(final String panelId) {
                return new OIDCProvidersDirectoryPanel(panelId, getPageReference());
            }
        });

        return tabs;
    }
 
Example #29
Source File: MyBusinessDisplay.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
private int addCompanyProfiles(final UserProfile userProfile,
		int visibleFieldCount) {
	
	WebMarkupContainer companyProfilesContainer = new WebMarkupContainer(
			"companyProfilesContainer");

	companyProfilesContainer.add(new Label("companyProfilesLabel",
			new ResourceModel("profile.business.company.profiles")));
	
	List<ITab> tabs = new ArrayList<ITab>();

	if (null != userProfile.getCompanyProfiles()) {

		for (final CompanyProfile companyProfile : userProfile
				.getCompanyProfiles()) {

			tabs.add(new AbstractTab(new ResourceModel("profile.business.company.profile")) {

				private static final long serialVersionUID = 1L;

				@Override
				public Panel getPanel(String panelId) {

					return new CompanyProfileDisplay(panelId, companyProfile);
				}

			});
		}
	}

	companyProfilesContainer.add(new AjaxTabbedPanel("companyProfiles", tabs));
	add(companyProfilesContainer);
	
	if (0 == tabs.size()) {			
		companyProfilesContainer.setVisible(false);
	} else {
		visibleFieldCount++;
	}

	return visibleFieldCount;
}
 
Example #30
Source File: ProjectPage.java    From webanno with Apache License 2.0 4 votes vote down vote up
private List<ITab> makeTabs()
{
    List<ITab> tabs = new ArrayList<>();
    
    tabs.add(new AbstractTab(Model.of("Details"))
    {
        private static final long serialVersionUID = 6703144434578403272L;

        @Override
        public Panel getPanel(String panelId)
        {
            return new ProjectDetailPanel(panelId, selectedProject);
        }

        @Override
        public boolean isVisible()
        {
            return selectedProject.getObject() != null;
        }
    });
    
    // Add the project settings panels from the registry
    for (ProjectSettingsPanelFactory psp : projectSettingsPanelRegistry.getPanels()) {
        String path = psp.getPath();
        AbstractTab tab = new AbstractTab(Model.of(psp.getLabel())) {
            private static final long serialVersionUID = -1503555976570640065L;

            private ProjectSettingsPanelRegistry getRegistry()
            {
                // @SpringBean doesn't work here and we cannot keep a reference on the 
                // projectSettingsPanelRegistry either because it is not serializable,
                // so we have no other chance here than fetching it statically
                return ApplicationContextProvider.getApplicationContext()
                        .getBean(ProjectSettingsPanelRegistry.class);
            }
            
            @Override
            public Panel getPanel(String aPanelId)
            {
                return getRegistry().getPanel(path).createSettingsPanel(aPanelId,
                        selectedProject);
            }

            @Override
            public boolean isVisible()
            {
                return selectedProject.getObject() != null
                        && selectedProject.getObject().getId() != null
                        && getRegistry().getPanel(path)
                                .applies(selectedProject.getObject());
            }
        };
        tabs.add(tab);
    }
    return tabs;
}