Codota Logo
HippoIcon.fromResource
Code IndexAdd Codota to your IDE (free)

How to use
fromResource
method
in
org.hippoecm.frontend.plugins.standards.icon.HippoIcon

Best Java code snippets using org.hippoecm.frontend.plugins.standards.icon.HippoIcon.fromResource (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.onehippo.cms7/hippo-cms-api

/**
 * Renders an icon stored in a resource. When the icon's file extension is '.svg',
 * the icon is rendered as an inline SVG image.
 * @param id the Wicket id of the icon
 * @param reference the resource to render
 * @return the icon component
 */
public static HippoIcon fromResource(final String id, final ResourceReference reference) {
  return fromResource(id, reference, -1, -1);
}
origin: org.onehippo.cms7/hippo-cms-api

protected Component getIcon(final String id) {
  if (iconReference != null) {
    return HippoIcon.fromResource(id, iconReference);
  }
  return null;
}
origin: org.onehippo.cms7/hippo-cms-api

@Override
protected Component newNodeIcon(final MarkupContainer parent, final String id, final TreeNode node) {
  ResourceReference nodeIcon = super.getNodeIcon(node);
  return HippoIcon.fromResource(id, nodeIcon);
}
origin: org.onehippo.cms7/hippo-cms-api

public HippoIcon addFromResource(final ResourceReference reference, final Position position) {
  final HippoIcon resourceIcon = HippoIcon.fromResource(icons.newChildId(), reference);
  addIcon(resourceIcon, position);
  return resourceIcon;
}
origin: org.onehippo.cms7/hippo-cms-api

public Component getIcon(String id, IconSize size) {
  if (decorator == null) {
    return null;
  }
  Component icon = decorator.getIcon(id, size);
  if (icon != null) {
    return icon;
  }
  ResourceReference reference = decorator.getIcon(size);
  return reference != null ? HippoIcon.fromResource(id, reference, size) : null;
}
origin: org.onehippo.cms7/hippo-cms-api

public HippoIcon replaceFromResource(final HippoIcon oldIcon, final ResourceReference newReference,
                   final Position position) {
  HippoIcon newCopy = HippoIcon.fromResource(oldIcon.getId(), newReference);
  addIcon(newCopy, position);
  return newCopy;
}
origin: org.onehippo.cms7/hippo-cms-api

/**
 * Renders an icon stored in a resource, including 'width' and 'height' attributes.
 * When the icon's file extension is '.svg', the icon is rendered as an inline SVG image.
 * @param id the Wicket id of the icon
 * @param reference the resource to render
 * @param size the size to use as width and height value, in pixels
 * @return the icon component
 */
public static HippoIcon fromResource(final String id, final ResourceReference reference, final IconSize size) {
  return fromResource(id, reference, size.getSize(), size.getSize());
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

private Component getDocumentIcon(final Node node, final String id, final IconSize size) throws RepositoryException {
  if (localeProvider != null) {
    if (node.isNodeType(HippoTranslationNodeType.NT_TRANSLATED)) {
      String localeName = node.getProperty(HippoTranslationNodeType.LOCALE).getString();
      for (HippoLocale locale : localeProvider.getLocales()) {
        if (localeName.equals(locale.getName())) {
          ResourceReference reference = locale.getIcon(size, LocaleState.EXISTS);
          return HippoIcon.fromResource(id, reference);
        }
      }
      log.info("Locale '{}' was not found in locale provider", localeName);
    }
  }
  return HippoIcon.fromSprite(id, Icon.FILE_TEXT);
}
origin: org.onehippo.cms7/hippo-cms-api

public static HippoIcon getIconForNodeType(final String id, final NodeType type, final Icon defaultIcon, final IconSize size) {
  final String nodeTypeIconName = StringUtils.replace(type.getName(), ":", "-");
  final ResourceReference reference = BrowserStyle.getIconOrNull(nodeTypeIconName, size);
  if (reference != null) {
    final HippoIcon icon = HippoIcon.fromResource(id, reference, size);
    icon.addCssClass("hi");
    icon.addCssClass("hi-custom-node-type");
    icon.addCssClass("hi-" + size.name().toLowerCase());
    return icon;
  }
  return HippoIcon.fromSprite(id, defaultIcon, size);
}
org.hippoecm.frontend.plugins.standards.iconHippoIconfromResource

Javadoc

Renders an icon stored in a resource. When the icon's file extension is '.svg', the icon is rendered as an inline SVG image.

Popular methods of HippoIcon

  • fromSprite
    Renders a hippo icon via a reference to the icon sprite.
  • inline
    Renders a hippo icon of size IconSize#M as an inline SVG. This makes it possible to, for example, st
  • addCssClass
    Adds a CSS class to the top-level element of the rendered icon.
  • copy
    Renders a copy of the given icon, with a different Wicket ID.
  • fromResourceModel
    Renders an icon stored in a resource which is referenced by a Wicket model. When the icon's file ext
  • fromStream
    Renders and icon/image from a JcrResourceStream which is referenced by an IModel. Delegates renderin
  • getId
  • setVisible

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now