當前位置: 首頁>>代碼示例>>Java>>正文


Java ComponentTag類代碼示例

本文整理匯總了Java中org.apache.wicket.markup.ComponentTag的典型用法代碼示例。如果您正苦於以下問題:Java ComponentTag類的具體用法?Java ComponentTag怎麽用?Java ComponentTag使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ComponentTag類屬於org.apache.wicket.markup包,在下文中一共展示了ComponentTag類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onConfigure

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
protected void onConfigure() {
    super.onConfigure();
    WebMarkupContainer container = new WebMarkupContainer("output") {
        @Override
        public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
            try {
                CharArrayWriter baos = new CharArrayWriter(0);
                DocumentationDefinitionResolver.get().renderDocumentationHTML(typeLoader.loadTypeOrException(stypeClass), baos);
                replaceComponentTagBody(markupStream, openTag, baos.toString());
            } catch (Exception e) {
                throw SingularException.rethrow(e.getMessage(), e);
            }
        }
    };
    queue(container);
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:18,代碼來源:DocumentationTablePage.java

示例2: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag) {
	ResourceReference resourceReference = getImageResourceReference();
	if (resourceReference == null) {
		throw new IllegalStateException("The target ResourceReference of an image of type " + getClass() + " was null when trying to render the url.");
	}
	
	PageParameters parameters;

	try {
		LinkParameterValidators.checkModel(parametersValidator);
		parameters = getParameters();
		LinkParameterValidators.checkSerialized(parameters, parametersValidator);
	} catch(LinkParameterValidationException e) {
		throw new LinkParameterValidationRuntimeException(e);
	}
	
	setImageResourceReference(resourceReference, parameters);
	
	super.onComponentTag(tag);
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:22,代碼來源:DynamicImage.java

示例3: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag)
{
	super.onComponentTag(tag);

	if (isEnabledInHierarchy())
	{
		if (tag.getName().equalsIgnoreCase("a"))
		{
			tag.put("href", "#");
		}
	}
	else
	{
		disableLink(tag);
	}
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:18,代碼來源:BlankLink.java

示例4: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
public void onComponentTag(Component component, ComponentTag tag) {
	super.onComponentTag(component, tag);

	// change the order of the two following method calls, otherwise ajax
	// links can never be disabled!
	// HACK issue #79: wicket changes tag name if component wasn't enabled
	Buttons.fixDisabledState(component, tag);
	Components.assertTag(component, tag, "a", "button", "input");

	// a menu button has no css classes, inherits its styles from the menu
	if (!Buttons.Type.Menu.equals(getType())) {
		Buttons.onComponentTag(component, tag, buttonSize.getObject(),
				buttonType.getObject(), blockProvider);
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:17,代碼來源:ButtonBehavior.java

示例5: getLink

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
protected Component getLink(String id) {
  PageParameters pageParameters = new PageParameters();
  pageParameters.put("topicMapId", getTopicMapId());
  pageParameters.put("topicId", getTopicId());
  
  return new BookmarkablePageLink<Page>(id, VizigatorPage.class, pageParameters) {
    @Override
    protected void onComponentTag(ComponentTag tag) {
      tag.setName("a");
      //tag.put("target", "_blank");
      super.onComponentTag(tag);
    }
    @Override
    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
      replaceComponentTagBody(markupStream, openTag, new ResourceModel("vizigator.text2").getObject().toString());
    }
  };
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:20,代碼來源:VizigatorLinkFunctionBoxPanel.java

示例6: replaceAttributeValue

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
/**
 * Checks the given component tag for an instance of the attribute to modify
 * and if all criteria are met then replace the value of this attribute with
 * the value of the contained model object.
 *
 * @param component The component
 * @param tag The tag to replace the attribute value for
 */
   private void replaceAttributeValue(final Component component, final ComponentTag tag) {
	if (isEnabled(component)) {
		final IValueMap attributes = tag.getAttributes();
		final Object replacementValue = getReplacementOrNull(component);

		if (VALUELESS_ATTRIBUTE_ADD == replacementValue) {
			attributes.put(attribute, null);
		} else if (VALUELESS_ATTRIBUTE_REMOVE == replacementValue) {
			attributes.remove(attribute);
		} else {
			final String value = toStringOrNull(attributes.get(attribute));
			final String newValue = newValue(value, toStringOrNull(replacementValue));
			if (newValue != null) {
				attributes.put(attribute, newValue);
			}
		}
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:27,代碼來源:UserProfilePictureBackgroundBehaviour.java

示例7: onComponentTagBody

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
    // render the hidden field
    if (isRootForm()) {
        AppendingStringBuffer buffer = new AppendingStringBuffer(
                "<div style=\"display:none\"><input type=\"hidden\" name=\"");
        buffer.append(TOKEN_NAME)
                .append("\" id=\"")
                .append(TOKEN_NAME)
                .append("\" value=\"")
                .append(getToken())
                .append("\" /></div>");
        getResponse().write(buffer);
    }

    // do the rest of the processing
    super.onComponentTagBody(markupStream, openTag);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:19,代碼來源:SecureForm.java

示例8: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
protected void onComponentTag(final ComponentTag tag) {
    /*
     * Anchors don't work with fallback, but we just ignore the exception when still needed by menu etc in
     * bootstrap. Thus this workaround.
     */
    final boolean anchor = "a".equals(tag.getName());
    if (anchor) {
        tag.setName("button");
    }
    super.onComponentTag(tag);
    if (anchor) {
        tag.setName("a");
        //if missing, add href to make cursor display properly
        if (Strings.isBlank(tag.getAttribute("href"))) {
            tag.put("href", "#");
        }
    }
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:20,代碼來源:ModelButton.java

示例9: linkCubesQuery

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
/**
 * @return
 */
private ExternalLink linkCubesQuery(
		final CubesMetricMeasurement cubesMetricMeasurement) {

	ExternalLink link = new  ExternalLink("linkCubesQuery", cubesMetricMeasurement.getSelf()){
		private static final long serialVersionUID = 1L;

		@Override
		protected void onComponentTag(ComponentTag tag) {
			super.onComponentTag(tag);
			tag.put("target","_blank");
		}
	};
	link.add(new Label("cubesMetric", new PropertyModel<String>(
			cubesMetricMeasurement, "cubesMetric")));

	// tooltip config
	TooltipConfig confConfig = new TooltipConfig()
			.withPlacement(TooltipConfig.Placement.top);
	link.add(new TooltipBehavior(new PropertyModel<String>(cubesMetricMeasurement,
			"self"), confConfig));

	return link;
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:27,代碼來源:CubeAnalysisDataManagementPage.java

示例10: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
protected void onComponentTag(final ComponentTag tag) {
    checkComponentTag(tag, "select");

    super.onComponentTag(tag);
    final IValueMap attrs = tag.getAttributes();

    attrs.put("multiple", "multiple");
    attrs.put("size", getPalette().getRows());

    if (!palette.isPaletteEnabled()) {
        attrs.put("disabled", "disabled");
    }

    avoidAjaxSerialization();
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:20,代碼來源:AOptions.java

示例11: onComponentTagBody

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
    // render the hidden field
    if (isRootForm()) {
        final AppendingStringBuffer buffer = new AppendingStringBuffer("<input type=\"hidden\" name=\"");
        buffer.append(TOKEN_NAME)
                .append("\" id=\"")
                .append(TOKEN_NAME)
                .append("\" value=\"")
                .append(token)
                .append("\" />");
        getResponse().write(buffer);
    }

    // do the rest of the processing
    super.onComponentTagBody(markupStream, openTag);
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:18,代碼來源:CsrfTokenForm.java

示例12: linkToJSON

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
/**
 * @return a link to JSON response in order to test the query
 */
private ExternalLink linkToJSON() {
  ExternalLink link = new ExternalLink("linkCubesQuery", query) {
    private static final long serialVersionUID = 1L;

    @Override
    protected void onComponentTag(ComponentTag tag) {
      super.onComponentTag(tag);
      tag.put("target", "_blank");
    }
  };

  link.add(new Label("query", query));

  return link;
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:19,代碼來源:AnalysisDrilldown.java

示例13: UploadIFrame

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
public UploadIFrame(FieldValueModel fieldValueModel) {
  this.fieldValueModel = fieldValueModel;

  // add header contributor for stylesheet
  add(CSSPackageResource.getHeaderContribution(getStylesheet()));
  
  WebMarkupContainer container = new WebMarkupContainer("container");
  container.setOutputMarkupId(true);
  add(container);
  // add form
  container.add(new UploadForm("form", container));
  // add onUploaded method
  container.add(new WebComponent("onUploaded") {
    @Override
    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
      if (uploaded) {
        replaceComponentTagBody(markupStream, openTag,
            "window.parent." + getOnUploadedCallback() + "('', '')");
        uploaded = false;
      }
    }            
  });
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:24,代碼來源:UploadIFrame.java

示例14: getModuleNameLink

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
/**
 * Returns a link that redirects to the module info
 *
 * @param componentId ID to assign to the link
 * @param moduleId    ID of module to display
 * @return Module redirection link
 */
private AjaxLink getModuleNameLink(String componentId, final String moduleId) {
    AjaxLink link = new AjaxLink<String>(componentId, Model.of(moduleId)) {

        @Override
        public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
            replaceComponentTagBody(markupStream, openTag, moduleId);
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            PageParameters pageParameters = new PageParameters();
            pageParameters.set(BUILD_NAME, build.getName());
            pageParameters.set(BUILD_NUMBER, build.getNumber());
            pageParameters.set(BUILD_STARTED, build.getStarted());
            pageParameters.set(MODULE_ID, moduleId);
            setResponsePage(BuildBrowserRootPage.class, pageParameters);
        }
    };
    link.add(new CssClass("item-link"));
    return link;
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:29,代碼來源:PublishedModulesTabPanel.java

示例15: newGroupByLink

import org.apache.wicket.markup.ComponentTag; //導入依賴的package包/類
private Component newGroupByLink(String id, final ISortStateLocator stateLocator, final String groupProperty) {
    return new AjaxLink(id) {
        @Override
        public void onClick(AjaxRequestTarget target) {
            if (stateLocator instanceof IGroupStateLocator) {
                IGroupStateLocator groupStateLocator = (IGroupStateLocator) stateLocator;
                switchGroupState(groupStateLocator, groupProperty);
                target.add(getTable());
            }
        }

        @Override
        protected void onComponentTag(ComponentTag tag) {
            super.onComponentTag(tag);
            tag.put("title", "Group By");
        }

        @Override
        protected IAjaxCallDecorator getAjaxCallDecorator() {
            return new CancelDefaultDecorator();
        }
    };
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:24,代碼來源:AjaxGroupableHeadersToolbar.java


注:本文中的org.apache.wicket.markup.ComponentTag類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。