Java Code Examples for org.apache.wicket.markup.html.basic.Label#setEscapeModelStrings()

The following examples show how to use org.apache.wicket.markup.html.basic.Label#setEscapeModelStrings() . 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: TaskPropertyColumn.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel)
{
  final TaskDO task = getTask(rowModel);
  if (task == null) {
    item.add(new Label(componentId, ""));
  } else {
    final Label label = new Label(componentId, task.getTitle());
    final String taskPath = getTaskFormatter().getTaskPath(task.getId(), false, OutputType.PLAIN);
    WicketUtils.addTooltip(label, taskPath);
    label.setEscapeModelStrings(false);
    item.add(label);
  }
  if (cellItemListener != null)
    cellItemListener.populateItem(item, componentId, rowModel);
}
 
Example 2
Source File: ProjektSelectPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param id
 * @param label Not yet in use.
 * @param model
 * @param caller
 * @param selectProperty
 */
@SuppressWarnings("serial")
public ProjektSelectPanel(final String id, final IModel<ProjektDO> model, final ISelectCallerPage caller, final String selectProperty)
{
  super(id, model, caller, selectProperty);
  projektAsStringLabel = new Label("projectAsString", new Model<String>() {

    @Override
    public String getObject()
    {
      final ProjektDO projekt = ProjektSelectPanel.this.getModelObject();
      final String str = projektFormatter.format(projekt, false);
      if (str == null) {
        return projektFormatter.getNotVisibleString();
      }
      return HtmlHelper.escapeXml(str);
    }
  });
  projektAsStringLabel.setEscapeModelStrings(false);
  add(projektAsStringLabel);
}
 
Example 3
Source File: ModalGeoPickerPage.java    From ontopia with Apache License 2.0 6 votes vote down vote up
public ModalGeoPickerPage(ModalWindow dialog, Topic thetopic) {
  super(dialog.getContentId());
  this.dialog = dialog;
  this.thetopic = new TopicModel<Topic>(thetopic);

  //setInitialHeight(700);

  final WebMarkupContainer popupContent = new WebMarkupContainer("popupContent");
  popupContent.setOutputMarkupId(true);
  add(popupContent);

  popupContent.add(new Label("title", new Model<String>("Pick location for '"+
                                                        thetopic.getName() +
                                                        "'")));

  behave = new ReceiveRequest(this);
  this.add(behave);

  // using a label to provide the callback URI to the JavaScript code
  // in the page. unfortunately, we don't know the URI here, so we set
  // things up, then insert it later.
  ajaxurlmodel = new Model<String>("// and the url is ...");
  ajaxurllabel = new Label("ajaxurl", ajaxurlmodel);
  ajaxurllabel.setEscapeModelStrings(false);
  popupContent.add(ajaxurllabel);
}
 
Example 4
Source File: LoginModalPanel.java    From AppStash with Apache License 2.0 5 votes vote down vote up
private Component javaScript() {
    Label modalContainerJS = new Label("modalContainerJS", new LoadableDetachableModel<String>() {
        @Override
        protected String load() {
            return String.format("$('#%s').hide()", modalContainer.getMarkupId());
        }
    });
    modalContainerJS.setEscapeModelStrings(false);
    return modalContainerJS;
}
 
Example 5
Source File: DashboardEmbedCodePanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
public DashboardEmbedCodePanel(String id, final String dashboardId) {
	super(id);						
					
	model = new ErrorLoadableDetachableModel(dashboardId);
	final Label codeLabel = new Label("code", model);
	codeLabel.setEscapeModelStrings(false);		
	codeLabel.setOutputMarkupId(true);
	add(codeLabel);					
			
	feedbackPanel = new FeedbackPanel("feedback");
       feedbackPanel.setOutputMarkupId(true);
       add(feedbackPanel);
						
}
 
Example 6
Source File: TaskListPage.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
static Label getStatusLabel(final String componentId, final TaskFormatter taskFormatter, final TaskDO task)
{
  final String formattedStatus = taskFormatter.getFormattedTaskStatus(task.getStatus());
  final Label label = new Label(componentId, formattedStatus);
  label.setEscapeModelStrings(false);
  return label;
}
 
Example 7
Source File: TaskListPage.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
static Label getPriorityLabel(final String componentId, final PriorityFormatter priorityFormatter, final TaskDO task)
{
  final String formattedPriority = priorityFormatter.getFormattedPriority(task.getPriority());
  final Label label = new Label(componentId, formattedPriority);
  label.setEscapeModelStrings(false);
  return label;
}
 
Example 8
Source File: AjaxLazyLoadImage.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * @param markupId
 *            The components markupid.
 * @return The component to show while the real component is being created.
 */
public Component getLoadingComponent(String markupId) {
	Label indicator = new Label(markupId, "<img src=\"" + RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null) + "\"/>");
	indicator.setEscapeModelStrings(false);
	indicator.add(new AttributeModifier("title", new Model("...")));
	return indicator;
}
 
Example 9
Source File: AjaxLazyLoadFragment.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * @param markupId The components markupid.
 * @return The component to show while the real component is being created.
 */
public Component getLoadingComponent(String markupId) {
	Label indicator = new Label(markupId, "<img src=\"" + RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null) + "\"/>");
	indicator.setEscapeModelStrings(false);
	indicator.add(new AttributeModifier("title", new Model("...")));
	return indicator;
}
 
Example 10
Source File: AjaxLazyLoadImage.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * @param markupId
 *            The components markupid.
 * @return The component to show while the real component is being created.
 */
public Component getLoadingComponent(String markupId) {
	Label indicator = new Label(markupId, "<img src=\"" + RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null) + "\"/>");
	indicator.setEscapeModelStrings(false);
	indicator.add(new AttributeModifier("title", new Model("...")));
	return indicator;
}
 
Example 11
Source File: AjaxLazyLoadFragment.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * @param markupId The components markupid.
 * @return The component to show while the real component is being created.
 */
public Component getLoadingComponent(String markupId) {
	Label indicator = new Label(markupId, "<img src=\"" + RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null) + "\"/>");
	indicator.setEscapeModelStrings(false);
	indicator.add(new AttributeModifier("title", new Model("...")));
	return indicator;
}
 
Example 12
Source File: LayerSelectionPanel.java    From webanno with Apache License 2.0 5 votes vote down vote up
private Label createRelationHint()
{
    Label label = new Label("relationHint", Model.of());
    label.setOutputMarkupPlaceholderTag(true);
    label.setEscapeModelStrings(false);
    label.add(LambdaBehavior.onConfigure(_this -> {
        if (layerSelector.getModelObject() != null) {
            List<AnnotationLayer> relLayers = annotationService
                    .listAttachedRelationLayers(layerSelector.getModelObject());
            if (relLayers.isEmpty()) {
                _this.setVisible(false);
            }
            else if (relLayers.size() == 1) {
                _this.setDefaultModelObject("Create a <b>"
                        + escapeMarkup(relLayers.get(0).getUiName(), false, false)
                        + "</b> relation by drawing an arc between annotations of this layer.");
                _this.setVisible(true);
            }
            else {
                _this.setDefaultModelObject(
                        "Whoops! Found more than one relation layer attaching to this span layer!");
                _this.setVisible(true);
            }
        }
        else {
            _this.setVisible(false);
        }
    }));
    return label;
}
 
Example 13
Source File: LoginModalPanel.java    From the-app with Apache License 2.0 5 votes vote down vote up
private Component javaScript() {
    Label modalContainerJS = new Label("modalContainerJS", new LoadableDetachableModel<String>() {
        @Override
        protected String load() {
            return String.format("$('#%s').hide()", modalContainer.getMarkupId());
        }
    });
    modalContainerJS.setEscapeModelStrings(false);
    return modalContainerJS;
}
 
Example 14
Source File: HtmlAnnotationEditor.java    From inception with Apache License 2.0 5 votes vote down vote up
public HtmlAnnotationEditor(String aId, IModel<AnnotatorState> aModel,
        AnnotationActionHandler aActionHandler, CasProvider aCasProvider)
{
    super(aId, aModel, aActionHandler, aCasProvider);

    vis = new Label("vis", LambdaModel.of(this::renderHtml));
    vis.setOutputMarkupId(true);
    vis.setEscapeModelStrings(false);
    add(vis);

    storeAdapter = new StoreAdapter();
    add(storeAdapter);
}
 
Example 15
Source File: ThreadDumpPage.java    From JPPF with Apache License 2.0 4 votes vote down vote up
/**
 *
 * @param info .
 */
public ThreadDumpPage(final String info) {
  final Label label = new Label("threaddump.info", info);
  label.setEscapeModelStrings(false);
  add(label);
}
 
Example 16
Source File: MyBusinessEdit.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public MyBusinessEdit(final String id, final UserProfile userProfile,
		List<CompanyProfile> companyProfilesToAdd,
		List<CompanyProfile> companyProfilesToRemove,
		TabDisplay tabDisplay) {

	super(id);

	log.debug("MyBusinessEdit()");

	this.companyProfilesToAdd = companyProfilesToAdd;
	this.companyProfilesToRemove = companyProfilesToRemove;

	// heading
	add(new Label("heading", new ResourceModel("heading.business.edit")));

	// setup form
	Form form = new Form("form", new Model(userProfile));
	form.setOutputMarkupId(true);

	// form submit feedback
	final Label formFeedback = new Label("formFeedback");
	formFeedback.setOutputMarkupPlaceholderTag(true);
	form.add(formFeedback);

	// add warning message if superUser and not editing own profile
	Label editWarning = new Label("editWarning");
	editWarning.setVisible(false);
	if (sakaiProxy.isSuperUserAndProxiedToUser(
			userProfile.getUserUuid())) {
		editWarning.setDefaultModel(new StringResourceModel(
				"text.edit.other.warning", null, new Object[] { userProfile
						.getDisplayName() }));
		editWarning.setEscapeModelStrings(false);
		editWarning.setVisible(true);
	}
	form.add(editWarning);

	// business biography
	WebMarkupContainer businessBiographyContainer = new WebMarkupContainer(
			"businessBiographyContainer");
	businessBiographyContainer.add(new Label("businessBiographyLabel",
			new ResourceModel("profile.business.bio")));
	TextArea businessBiography = new TextArea(
			"businessBiography", new PropertyModel<String>(userProfile,
					"businessBiography"));
	businessBiography.setMarkupId("businessbioinput");
	businessBiography.setOutputMarkupId(true);
	//businessBiography.setEditorConfig(CKEditorConfig.createCkConfig());
	businessBiographyContainer.add(businessBiography);
	form.add(businessBiographyContainer);

	// company profiles
	WebMarkupContainer companyProfileEditsContainer = createCompanyProfileEditsContainer(userProfile, tabDisplay);
	form.add(companyProfileEditsContainer);

	AjaxFallbackButton addCompanyProfileButton = createAddCompanyProfileButton(
			id, userProfile, form, formFeedback);
	form.add(addCompanyProfileButton);

	AjaxFallbackButton removeCompanyProfileButton = createRemoveCompanyProfileButton(
			id, userProfile, form);
	form.add(removeCompanyProfileButton);

	AjaxFallbackButton submitButton = createSaveChangesButton(id,
			userProfile, form, formFeedback);
	//submitButton.add(new CKEditorTextArea.CKEditorAjaxSubmitModifier());
	form.add(submitButton);

	AjaxFallbackButton cancelButton = createCancelChangesButton(id,
			userProfile, form);
	form.add(cancelButton);

	add(form);
}
 
Example 17
Source File: MyBusinessEdit.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public MyBusinessEdit(final String id, final UserProfile userProfile,
		List<CompanyProfile> companyProfilesToAdd,
		List<CompanyProfile> companyProfilesToRemove,
		TabDisplay tabDisplay) {

	super(id);

	log.debug("MyBusinessEdit()");

	this.companyProfilesToAdd = companyProfilesToAdd;
	this.companyProfilesToRemove = companyProfilesToRemove;

	// heading
	add(new Label("heading", new ResourceModel("heading.business.edit")));

	// setup form
	Form form = new Form("form", new Model(userProfile));
	form.setOutputMarkupId(true);

	// form submit feedback
	final Label formFeedback = new Label("formFeedback");
	formFeedback.setOutputMarkupPlaceholderTag(true);
	form.add(formFeedback);

	// add warning message if superUser and not editing own profile
	Label editWarning = new Label("editWarning");
	editWarning.setVisible(false);
	if (sakaiProxy.isSuperUserAndProxiedToUser(
			userProfile.getUserUuid())) {
		editWarning.setDefaultModel(new StringResourceModel(
				"text.edit.other.warning", null, new Object[] { userProfile
						.getDisplayName() }));
		editWarning.setEscapeModelStrings(false);
		editWarning.setVisible(true);
	}
	form.add(editWarning);

	// business biography
	WebMarkupContainer businessBiographyContainer = new WebMarkupContainer(
			"businessBiographyContainer");
	businessBiographyContainer.add(new Label("businessBiographyLabel",
			new ResourceModel("profile.business.bio")));
	TextArea businessBiography = new TextArea(
			"businessBiography", new PropertyModel<String>(userProfile,
					"businessBiography"));
	businessBiography.setMarkupId("businessbioinput");
	businessBiography.setOutputMarkupId(true);
	//businessBiography.setEditorConfig(CKEditorConfig.createCkConfig());
	businessBiographyContainer.add(businessBiography);
	form.add(businessBiographyContainer);

	// company profiles
	WebMarkupContainer companyProfileEditsContainer = createCompanyProfileEditsContainer(userProfile, tabDisplay);
	form.add(companyProfileEditsContainer);

	AjaxFallbackButton addCompanyProfileButton = createAddCompanyProfileButton(
			id, userProfile, form, formFeedback);
	form.add(addCompanyProfileButton);

	AjaxFallbackButton removeCompanyProfileButton = createRemoveCompanyProfileButton(
			id, userProfile, form);
	form.add(removeCompanyProfileButton);

	AjaxFallbackButton submitButton = createSaveChangesButton(id,
			userProfile, form, formFeedback);
	//submitButton.add(new CKEditorTextArea.CKEditorAjaxSubmitModifier());
	form.add(submitButton);

	AjaxFallbackButton cancelButton = createCancelChangesButton(id,
			userProfile, form);
	form.add(cancelButton);

	add(form);
}
 
Example 18
Source File: PersonalStatisticsPage.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
public PersonalStatisticsPage(final PageParameters parameters)
{
  super(parameters);
  final Label timesheetDisciplineChartTitle = new Label("timesheetDisciplineChartTitle",
      getString("personal.statistics.timesheetDisciplineChart.title"));
  body.add(timesheetDisciplineChartTitle);
  final EmployeeDO employee = employeeDao.getByUserId(PFUserContext.getUserId());
  double workingHoursPerDay = 8;
  if (employee != null && NumberHelper.isGreaterZero(employee.getWeeklyWorkingHours()) == true) {
    workingHoursPerDay = employee.getWeeklyWorkingHours().doubleValue() / 5;
  }
  final TimesheetDisciplineChartBuilder chartBuilder = new TimesheetDisciplineChartBuilder();
  final JFreeChart chart1 = chartBuilder.create(timesheetDao, getUser().getId(), workingHoursPerDay, LAST_N_DAYS, true);
  JFreeChartImage image = new JFreeChartImage("timesheetStatisticsImage1", chart1, IMAGE_WIDTH, IMAGE_HEIGHT);
  image.add(AttributeModifier.replace("width", String.valueOf(IMAGE_WIDTH)));
  image.add(AttributeModifier.replace("height", String.valueOf(IMAGE_HEIGHT)));
  body.add(image);
  final NumberFormat format = NumberFormat.getNumberInstance(PFUserContext.getLocale());
  final String planHours = "<span style=\"color: #DE1821; font-weight: bold;\">"
      + format.format(chartBuilder.getPlanWorkingHours())
      + "</span>";
  final String actualHours = "<span style=\"color: #40A93B; font-weight: bold;\">"
      + format.format(chartBuilder.getActualWorkingHours())
      + "</span>";
  final String numberOfDays = String.valueOf(LAST_N_DAYS);
  final Label timesheetDisciplineChart1Legend = new Label("timesheetDisciplineChart1Legend", getLocalizedMessage(
      "personal.statistics.timesheetDisciplineChart1.legend", numberOfDays, planHours, actualHours));
  timesheetDisciplineChart1Legend.setEscapeModelStrings(false);
  body.add(timesheetDisciplineChart1Legend);

  final JFreeChart chart2 = chartBuilder.create(timesheetDao, getUser().getId(), LAST_N_DAYS, true);
  image = new JFreeChartImage("timesheetStatisticsImage2", chart2, IMAGE_WIDTH, IMAGE_HEIGHT);
  image.add(AttributeModifier.replace("width", String.valueOf(IMAGE_WIDTH)));
  image.add(AttributeModifier.replace("height", String.valueOf(IMAGE_HEIGHT)));
  body.add(image);
  final String averageDifference = "<span style=\"color: #DE1821; font-weight: bold;\">"
      + format.format(chartBuilder.getAverageDifferenceBetweenTimesheetAndBooking())
      + "</span>";
  final String plannedDifference = "<span style=\"color: #40A93B; font-weight: bold;\">"
      + format.format(chartBuilder.getPlannedAverageDifferenceBetweenTimesheetAndBooking())
      + "</span>";
  final Label timesheetDisciplineChart2Legend = new Label("timesheetDisciplineChart2Legend", getLocalizedMessage(
      "personal.statistics.timesheetDisciplineChart2.legend", numberOfDays, plannedDifference, averageDifference));
  timesheetDisciplineChart2Legend.setEscapeModelStrings(false);
  body.add(timesheetDisciplineChart2Legend);
}
 
Example 19
Source File: SystemInfoPage.java    From JPPF with Apache License 2.0 4 votes vote down vote up
/**
 *
 * @param info .
 */
public SystemInfoPage(final String info) {
  final Label label = new Label("system.info", info);
  label.setEscapeModelStrings(false);
  add(label);
}