Java Code Examples for org.apache.wicket.markup.html.WebMarkupContainer#add()

The following examples show how to use org.apache.wicket.markup.html.WebMarkupContainer#add() . 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: ParametersWizardSchemaStep.java    From syncope with Apache License 2.0 6 votes vote down vote up
public ParametersWizardSchemaStep(final ParametersWizardPanel.ParametersForm modelObject) {
    modelObject.getSchema().setMandatoryCondition("false");

    WebMarkupContainer content = new WebMarkupContainer("content");
    this.setOutputMarkupId(true);
    content.setOutputMarkupId(true);
    add(content);

    AjaxDropDownChoicePanel<AttrSchemaType> type = new AjaxDropDownChoicePanel<>(
            "type", getString("type"), new PropertyModel<>(modelObject.getSchema(), "type"));
    type.setChoices(List.of(
            AttrSchemaType.String, AttrSchemaType.Long, AttrSchemaType.Double,
            AttrSchemaType.Boolean, AttrSchemaType.Date, AttrSchemaType.Binary));
    content.add(type);

    content.add(new AjaxCheckBoxPanel("multivalue", getString("multivalue"),
            new PropertyModel<>(modelObject.getSchema(), "multivalue")));
}
 
Example 2
Source File: AboutPage.java    From artifact-listener with Apache License 2.0 6 votes vote down vote up
public AboutPage(PageParameters parameters) {
	super(parameters);
	
	addBreadCrumbElement(new BreadCrumbElement(new ResourceModel("about.pageTitle"), linkDescriptor()));
	
	add(new Label("pageTitle", new ResourceModel("about.pageTitle")));
	
	final Model<ExternalLinks> externalLinksModel = Model.of(ExternalLinks.get(configurer));
	
	add(new Label("content", new StringResourceModel("about.content", externalLinksModel)).setEscapeModelStrings(false));
	
	WebMarkupContainer gitHubProjectContainer = new WebMarkupContainer("gitHubProjectContainer") {
		private static final long serialVersionUID = 1L;
		
		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(StringUtils.hasText(externalLinksModel.getObject().getGitHubProject()));
		}
	};
	add(gitHubProjectContainer);
	gitHubProjectContainer.add(new Label("gitHubProjectInsert", new StringResourceModel("about.insert.gitHubProject", externalLinksModel)).setEscapeModelStrings(false));
	
	add(new Label("hireInsert", new StringResourceModel("about.insert.hire", externalLinksModel)).setEscapeModelStrings(false));
}
 
Example 3
Source File: RadioGroupPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
public Radio<T> add(final Model<T> model, final String labelString, final String tooltip)
{
  final WebMarkupContainer cont = new WebMarkupContainer(repeater.newChildId());
  repeater.add(cont);
  final Radio<T> radio = new Radio<T>("radio", model, radioGroup);
  if (autosubmit == true) {
    radio.add(AttributeModifier.replace("onchange", "javascript:submit();"));
  }
  cont.add(radio);
  final Label label = new Label("label", labelString);
  label.add(AttributeModifier.replace("for", radio.setOutputMarkupId(true).getMarkupId()));
  label.setRenderBodyOnly(true);
  cont.add(label);
  if (tooltip != null) {
    WicketUtils.addTooltip(label, tooltip);
  }
  return radio;
}
 
Example 4
Source File: AbstractGroups.java    From syncope with Apache License 2.0 6 votes vote down vote up
public <T extends AnyTO> AbstractGroups(final AnyWrapper<T> modelObject) {
    super();
    this.anyTO = modelObject.getInnerObject();

    setOutputMarkupId(true);

    groupsContainer = new WebMarkupContainer("groupsContainer");
    groupsContainer.setOutputMarkupId(true);
    groupsContainer.setOutputMarkupPlaceholderTag(true);
    add(groupsContainer);

    // ------------------
    // insert changed label if needed
    // ------------------
    if (modelObject instanceof UserWrapper
            && UserWrapper.class.cast(modelObject).getPreviousUserTO() != null
            && !ListUtils.isEqualList(
                    UserWrapper.class.cast(modelObject).getInnerObject().getMemberships(),
                    UserWrapper.class.cast(modelObject).getPreviousUserTO().getMemberships())) {
        groupsContainer.add(new LabelInfo("changed", StringUtils.EMPTY));
    } else {
        groupsContainer.add(new Label("changed", StringUtils.EMPTY));
    }
    // ------------------
}
 
Example 5
Source File: MultilevelPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
public MultilevelPanel(final String id) {
    super(id);

    firstLevelContainer = new WebMarkupContainer("firstLevelContainer");
    firstLevelContainer.setOutputMarkupPlaceholderTag(true);
    firstLevelContainer.setVisible(true);
    add(firstLevelContainer);

    secondLevelContainer = new WebMarkupContainer("secondLevelContainer");
    secondLevelContainer.setOutputMarkupPlaceholderTag(true);
    secondLevelContainer.setVisible(false);
    add(secondLevelContainer);

    secondLevelContainer.add(new AjaxLink<String>("back") {

        private static final long serialVersionUID = -7978723352517770644L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            onClickBackInternal(target);
            prev(target);
        }
    });
}
 
Example 6
Source File: Dashboard.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Dashboard(final PageParameters parameters) {
    super(parameters);

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()));
    body.add(content);
}
 
Example 7
Source File: ButtonGroupPanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
public ButtonGroupPanel(final String id)
{
  super(id);
  container = new WebMarkupContainer("container");
  add(container);
  repeater = new RepeatingView("repeater");
  container.add(repeater);
}
 
Example 8
Source File: AlarmHTML5Panel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
public AlarmHTML5Panel(String id, String width, String height, IModel<AlarmData> model) {
		super(id, model);
		
		WebMarkupContainer container = new WebMarkupContainer("alarmCanvas");
		container.setOutputMarkupId(true);
//		container.add(new AttributeAppender("width", width));
		container.add(new AttributeAppender("height", height));
		zoom = "100%".equals(width) || "100%".equals(height);
		add(container);
	}
 
Example 9
Source File: AbstractMultiPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
public AbstractMultiPanel(
        final String id,
        final String name,
        final IModel<List<INNER>> model) {

    super(id, name, model);

    // -----------------------
    // Object container definition
    // -----------------------
    container = new WebMarkupContainer("multiValueContainer");
    container.setOutputMarkupId(true);
    add(container);

    form = new Form<>("innerForm");
    form.setDefaultButton(null);
    container.add(form);
    // -----------------------

    view = new InnerView("view", name, model);

    final List<INNER> obj = model.getObject();
    if (obj == null || obj.isEmpty()) {
        form.addOrReplace(getNoDataFragment(model, name));
    } else {
        form.addOrReplace(getDataFragment());
    }
}
 
Example 10
Source File: MenuItem.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public MenuItem(String id, IModel itemText, Class itemPageClass, PageParameters pageParameters, boolean first, Class menusCurrentPageClass) {
	super(id);

	boolean currentPage = itemPageClass.equals(menusCurrentPageClass);

	// link version
	menuItemLinkHolder = new WebMarkupContainer("menuItemLinkHolder");
	menuItemLink = new BookmarkablePageLink("menuItemLink", itemPageClass, pageParameters);
	menuLinkText = new Label("menuLinkText", itemText);
	menuLinkText.setRenderBodyOnly(true);
	menuItemLink.add(menuLinkText);
	menuItemLinkHolder.add(menuItemLink);
	menuItemLinkHolder.setVisible(!currentPage);
	add(menuItemLinkHolder);

	// span version
	menuItemLabel = new Label("menuItemLabel", itemText);
	menuItemLabel.setVisible(currentPage);
	add(menuItemLabel);
	
	//add current page styling
	AttributeModifier currentPageStyling = new AttributeModifier("class", new Model("current"));
	if(currentPage) {
		menuItemLabel.add(currentPageStyling);
	}

	if(first) {
		add(new AttributeModifier("class", new Model("firstToolBarItem")));
	}
}
 
Example 11
Source File: DisplayHTML5Panel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
public DisplayHTML5Panel(String id, String width, String height, IModel<DisplayData> model) {
	super(id, model);
	
	WebMarkupContainer container = new WebMarkupContainer("displayCanvas");
	container.setOutputMarkupId(true);
	container.add(new AttributeAppender("width", width));
	container.add(new AttributeAppender("height", height));
	zoom = "100%".equals(width) || "100%".equals(height);
	add(container);
}
 
Example 12
Source File: SubjectObjectFeatureEditor.java    From inception with Apache License 2.0 5 votes vote down vote up
public SubjectObjectFeatureEditor(String aId, MarkupContainer aOwner,
    AnnotationActionHandler aHandler, final IModel<AnnotatorState> aStateModel,
    final IModel<FeatureState> aFeatureStateModel, String role)
{
    super(aId, aOwner, CompoundPropertyModel.of(aFeatureStateModel));

    stateModel = aStateModel;
    actionHandler = aHandler;
    project = this.getModelObject().feature.getProject();

    add(createDisabledKbWarningLabel());

    content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    add(content);

    List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) SubjectObjectFeatureEditor.this
        .getModelObject().value;

    roleModel = new LinkWithRoleModel();
    roleModel.role = role;
    if (links.size() == 1) {
        roleModel = links.get(0);
    }

    content.add(createSubjectObjectLabel());
    content.add(createRemoveLabelIcon());
    content.add(focusComponent = createAutoCompleteTextField());
}
 
Example 13
Source File: NavigationToolbar.java    From onedev with MIT License 5 votes vote down vote up
/**
 * Constructor
 * 
 * @param table
 *            data table this toolbar will be attached to
 */
public NavigationToolbar(final DataTable<?, ?> table)
{
	super(table);

	WebMarkupContainer span = new WebMarkupContainer("span") {

		private static final long serialVersionUID = 1L;

		@Override
		protected void onBeforeRender() {
			addOrReplace(newPagingNavigator("navigator", table));
			addOrReplace(newNavigatorLabel("navigatorLabel", table));
			super.onBeforeRender();
		}
		
	};
	add(span);
	span.add(AttributeModifier.replace("colspan", new AbstractReadOnlyModel<String>()
	{
		private static final long serialVersionUID = 1L;

		@Override
		public String getObject()
		{
			return String.valueOf(table.getColumns().size()).intern();
		}
	}));

}
 
Example 14
Source File: Policies.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Policies(final PageParameters parameters) {
    super(parameters);

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

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("policies");
    content.add(new AjaxBootstrapTabbedPanel<>(
            "tabbedPanel", SyncopeWebApplication.get().getPolicyTabProvider().buildTabList(getPageReference())));
    body.add(content);
}
 
Example 15
Source File: RecommendedArtifactPortfolioPanel.java    From artifact-listener with Apache License 2.0 4 votes vote down vote up
@Override
protected void addItemColumns(final Item<Artifact> item, IModel<? extends Artifact> itemModel) {
	item.setOutputMarkupId(true);
	
	Artifact artifact = item.getModelObject();
	final IModel<Artifact> artifactModel = new ArtifactModel(Model.of(item.getModelObject().getArtifactKey()));
	final ArtifactLastVersionModel artifactLastVersionModel = new ArtifactLastVersionModel(artifactModel);
	
	item.add(new ClassAttributeAppender(new LoadableDetachableModel<String>() {
		private static final long serialVersionUID = 1L;
		
		@Override
		protected String load() {
			User user = MavenArtifactNotifierSession.get().getUser();
			boolean isFollowed = user != null && userService.isFollowedArtifact(user, item.getModelObject());
			boolean isDeprecated = artifactModel.getObject() != null &&
					ArtifactDeprecationStatus.DEPRECATED.equals(artifactModel.getObject().getDeprecationStatus());
			return isFollowed ? "success" : (isDeprecated ? "warning" : null);
		}
	}));
	
	// GroupId column
	item.add(new Label("groupId", BindingModel.of(artifactModel, Binding.artifact().group().groupId())));
	item.add(new ExternalLink("groupLink", mavenCentralSearchUrlService.getGroupUrl(artifact.getGroup().getGroupId())));

	// ArtifactId column
	Link<Void> localArtifactLink = ArtifactDescriptionPage.linkDescriptor(artifactModel).link("localArtifactLink");
	localArtifactLink.add(new Label("artifactId", BindingModel.of(artifactModel, Binding.artifact().artifactId())));
	item.add(localArtifactLink);
	
	item.add(new ExternalLink("artifactLink", mavenCentralSearchUrlService.getArtifactUrl(artifact.getGroup().getGroupId(), artifact.getArtifactId())));
	
	// LastVersion, lastUpdateDate columns
	item.add(new Label("synchronizationPlannedPlaceholder", new ResourceModel("artifact.follow.synchronizationPlanned")) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(artifactModel.getObject() != null && !artifactLastVersionModel.isLastVersionAvailable());
		}
	});
	
	WebMarkupContainer localContainer = new WebMarkupContainer("followedArtifact") {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(artifactLastVersionModel.isLastVersionAvailable());
		}
	};
	localContainer.add(new ArtifactVersionTagPanel("latestVersion", Model.of(artifactLastVersionModel.getLastVersion())));
	String latestVersion = (artifact.getLatestVersion() != null ? artifact.getLatestVersion().getVersion() : "");
	localContainer.add(new ExternalLink("versionLink", mavenCentralSearchUrlService.getVersionUrl(artifact.getGroup().getGroupId(),
			artifact.getArtifactId(), latestVersion)));
	
	localContainer.add(new DateLabelWithPlaceholder("lastUpdateDate",
			Model.of(artifactLastVersionModel.getLastVersionUpdateDate()), DatePattern.SHORT_DATE));
	item.add(localContainer);

	// Followers count column
	Label followersCount = new CountLabel("followersCount", "artifact.follow.dataView.followers",
			BindingModel.of(artifactModel, Binding.artifact().followersCount()));
	followersCount.add(new AttributeModifier("class", new LoadableDetachableModel<String>() {
		private static final long serialVersionUID = 1L;

		@Override
		protected String load() {
			if (artifactModel.getObject() != null && artifactModel.getObject().getFollowersCount() > 0) {
				return "badge";
			}
			return null;
		}
	}));
	item.add(followersCount);
	
	// Follow actions
	item.add(new ArtifactFollowActionsPanel("followActions", artifactModel));
}
 
Example 16
Source File: ParamListViewPanel.java    From onedev with MIT License 4 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	RepeatingView paramsView = new RepeatingView("params");
	for (ParamSupply param: params) {
		WebMarkupContainer paramItem = new WebMarkupContainer(paramsView.newChildId());
		paramItem.add(new Label("name", param.getName()));
		
		if (param.getValuesProvider() instanceof SpecifiedValues) {
			if (param.isSecret())
				paramItem.add(new Label("valuesProvider", SpecifiedValues.SECRET_DISPLAY_NAME));
			else
				paramItem.add(new Label("valuesProvider", SpecifiedValues.DISPLAY_NAME));
			Fragment fragment = new Fragment("values", "specifiedValuesFrag", this);
			RepeatingView valuesView = new RepeatingView("values");
			SpecifiedValues specifiedValues = (SpecifiedValues) param.getValuesProvider();
			for (List<String> value: specifiedValues.getValues()) {
				WebMarkupContainer valueItem = new WebMarkupContainer(valuesView.newChildId());
				if (value.size() == 0) 
					valueItem.add(new Label("value", "<i>Empty</i>").setEscapeModelStrings(false));
				else if (value.size() == 1)
					valueItem.add(new Label("value", value.iterator().next()));
				else 
					valueItem.add(new Label("value", value.toString()));
				valuesView.add(valueItem);
			}
			fragment.add(valuesView);
			paramItem.add(fragment);
		} else if (param.getValuesProvider() instanceof ScriptingValues) {
			if (param.isSecret())
				paramItem.add(new Label("valuesProvider", ScriptingValues.SECRET_DISPLAY_NAME));
			else
				paramItem.add(new Label("valuesProvider", ScriptingValues.DISPLAY_NAME));
			paramItem.add(PropertyContext.view("values", param.getValuesProvider(), "scriptName"));
		} else {
			paramItem.add(new Label("valuesProvider", Ignore.DISPLAY_NAME));
			paramItem.add(new WebMarkupContainer("values"));
		}
		paramsView.add(paramItem);
	}
	add(paramsView);
}
 
Example 17
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 18
Source File: TableRendererPanel.java    From nextreports-server with Apache License 2.0 4 votes vote down vote up
public TableRendererPanel(String id, IModel<Report> model, final String widgetId, DrillEntityContext drillContext,  boolean zoom,  Map<String, Object> urlQueryParameters) throws NoDataFoundException {
	super(id, model);
	this.drillContext = drillContext;
	this.widgetId = widgetId;
	
	ro.nextreports.engine.Report rep = null;
			
	if ((drillContext != null) && (drillContext.getColumn() > 0)) {
		rep = NextUtil.getNextReport(storageService.getSettings(), model.getObject());
		drillPattern = NextUtil.getDetailColumnPattern(rep, drillContext.getColumn()-1);			
	} else {
		if (model != null) {
			rep = NextUtil.getNextReport(storageService.getSettings(), model.getObject());
		} else {
			try {
				EntityWidget widget = (EntityWidget)dashboardService.getWidgetById(widgetId);	
				if (widget.getEntity() instanceof Chart) {						
					rep = NextUtil.getNextReport((Chart)widget.getEntity());						
				} else {
					rep = NextUtil.getNextReport(storageService.getSettings(), (Report)widget.getEntity());
				}
			} catch (NotFoundException e) {
				LOG.error(e.getMessage(), e);
			}
		}
	}
	
	if (TableWidget.ALLOW_COLUMNS_SORTING) {
		this.allowSorting = reportHasHeaderAndOneDetail(rep);
	}
	
	if (urlQueryParameters != null) {
		Object tableFontSizeObj = urlQueryParameters.get("tableFontSize");
		if (tableFontSizeObj != null) {
			iframeFontSize = (String)tableFontSizeObj;
		}
		Object tableCellPaddingObj = urlQueryParameters.get("tableCellPadding");
		if (tableCellPaddingObj != null) {
			iframeCellPadding = (String)tableCellPaddingObj;
		}
	}				
	final TableDataProvider dataProvider = new TableDataProvider(widgetId, drillContext, urlQueryParameters);
	WebMarkupContainer container = new WebMarkupContainer("tableContainer");		
	final FilterForm filterForm = new FilterForm("filterForm", dataProvider) {			
		protected void onSubmit() {						
			NextServerSession.get().setTableFilter(widgetId, dataProvider.getFilterState());
	    	for(int i=0, size=dataProvider.getColumnCount(); i< size; i++) {
	    		System.out.println(dataProvider.getFilterState().getCellValues().get(i));
	    	}
		}
	};
	setCurrentTable(filterForm, dataProvider, widgetId);
	container.add(filterForm);
	boolean single = dashboardService.isSingleWidget(widgetId);		
	// table is the single widget in a dashboard with one column
	// make the height 100%
	// see WidgetPanel.html where we make the parent with overflow visible!
	if (single) {		
		container.add(AttributeModifier.replace("class", "tableWidgetViewFull"));
	}
       add(container);
       
       
}
 
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: SystemUpdateForm.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("serial")
protected void updateEntryRows()
{
  scripts.removeAll();
  final RepeatingView scriptRows = new RepeatingView("scriptRows");
  scripts.add(scriptRows);
  final SortedSet<UpdateEntry> updateEntries = parentPage.myDatabaseUpdater.getSystemUpdater().getUpdateEntries();
  if (updateEntries == null) {
    return;
  }
  boolean odd = true;
  for (final UpdateEntry updateEntry : updateEntries) {
    if (showOldUpdateScripts == false && updateEntry.getPreCheckStatus() == UpdatePreCheckStatus.ALREADY_UPDATED) {
      continue;
    }
    final Version version = updateEntry.getVersion();
    final WebMarkupContainer item = new WebMarkupContainer(scriptRows.newChildId());
    scriptRows.add(item);
    if (odd == true) {
      item.add(AttributeModifier.append("class", "odd"));
    } else {
      item.add(AttributeModifier.append("class", "even"));
    }
    odd = !odd;
    item.add(new Label("regionId", updateEntry.getRegionId()));
    if (updateEntry.isInitial() == true) {
      item.add(new Label("version", "initial"));
    } else {
      item.add(new Label("version", version.toString()));
    }
    final String description = updateEntry.getDescription();
    item.add(new Label("description", StringUtils.isBlank(description) == true ? "" : description));
    item.add(new Label("date", updateEntry.getDate()));
    final String preCheckResult = updateEntry.getPreCheckResult();
    item.add(new Label("preCheckResult", HtmlHelper.escapeHtml(preCheckResult, true)));
    if (updateEntry.getPreCheckStatus() == UpdatePreCheckStatus.READY_FOR_UPDATE) {
      final Button updateButton = new Button("button", new Model<String>("update")) {
        @Override
        public final void onSubmit()
        {
          parentPage.update(updateEntry);
        }
      };
      item.add(new SingleButtonPanel("update", updateButton, "update"));
    } else {
      final String runningResult = updateEntry.getRunningResult();
      item.add(new Label("update", HtmlHelper.escapeHtml(runningResult, true)));
    }
  }
}