@Inject public MavenCommandType( MavenResources resources, MavenCommandPagePresenter page, IconRegistry iconRegistry) { pages = new LinkedList<>(); pages.add(page); iconRegistry.registerIcon(new Icon("command.type." + ID, resources.maven())); }
for(Icon icon: list){ Image img = icon.getImage() ;
private SVGResource getCommandGoalIcon() { final String goalId = commandGoal.getId(); final Icon icon = iconRegistry.getIconIfExist("command.goal." + goalId); if (icon != null) { final SVGImage svgImage = icon.getSVGImage(); if (svgImage != null) { return icon.getSVGResource(); } } return null; } }
if (proposal.getIcon() != null && proposal.getIcon().getSVGImage() != null) { icon.appendChild((Node) proposal.getIcon().getSVGImage().getElement()); } else if (proposal.getIcon() != null && proposal.getIcon().getImage() != null) { icon.appendChild((Node) proposal.getIcon().getImage().getElement());
private Element renderCategoryHeader(String category) { SpanElement categoryElement = Document.get().createSpanElement(); categoryElement.setClassName(resources.defaultCategoriesListCss().headerText()); SpanElement iconElement = Document.get().createSpanElement(); categoryElement.appendChild(iconElement); SpanElement textElement = Document.get().createSpanElement(); categoryElement.appendChild(textElement); textElement.setInnerText(category); Icon icon = iconRegistry.getIconIfExist(category + ".samples.category.icon"); if (icon != null) { final SVGImage iconSVG = icon.getSVGImage(); if (iconSVG != null) { iconElement.appendChild(iconSVG.getElement()); return categoryElement; } } return categoryElement; }
@Override public void registerIcon(Icon icon) { icons.put(icon.getId(), icon); }
final SVGImage iconSVG = icon.getSVGImage(); if (iconSVG != null) { iconElement.appendChild(iconSVG.getElement());
@Inject public CustomCommandType( MachineResources resources, IconRegistry iconRegistry, CustomPagePresenter page) { pages = new LinkedList<>(); pages.add(page); iconRegistry.registerIcon(new Icon("command.type." + ID, resources.customCommandType())); }
/** Returns the icon for the given command type ID or {@code null} if none. */ @Nullable public SVGResource getCommandTypeIcon(String typeId) { final Optional<CommandType> commandType = commandTypeRegistry.getCommandTypeById(typeId); if (commandType.isPresent()) { final Icon icon = iconRegistry.getIconIfExist("command.type." + commandType.get().getId()); if (icon != null) { final SVGImage svgImage = icon.getSVGImage(); if (svgImage != null) { return icon.getSVGResource(); } } } return null; }
Icon icon = new ImageIcon("0.png"); Icon icon1 = new ImageIcon("2.png"); Image image1 = icon.getImage(); Image image2 = icon1.getImage(); int w = image1.width + image2.width; int h = Math.max(image1.height, image2.height); Image image = new BufferedImage(w, h, TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); g2.drawImage(image1, 0, 0, null); g2.drawImage(image2, image1.width, 0, null); g2.dispose(); ImageIcon newImg = new ImageIcon(image);
@Inject public GwtCommandType( GwtResources resources, GwtCommandPagePresenter page, CurrentProjectPathMacro currentProjectPathMacro, DevMachineHostNameMacro devMachineHostNameMacro, IconRegistry iconRegistry) { this.currentProjectPathMacro = currentProjectPathMacro; this.devMachineHostNameMacro = devMachineHostNameMacro; pages = new LinkedList<>(); pages.add(page); iconRegistry.registerIcon(new Icon("command.type." + ID, resources.gwtCommandType())); }
/** Returns the icon for the given command goal ID or {@code null} if none. */ @Nullable public SVGResource getCommandGoalIcon(String goalId) { final Optional<CommandGoal> goalOptional = goalRegistry.getPredefinedGoalById(goalId); if (goalOptional.isPresent()) { final Icon icon = iconRegistry.getIconIfExist("command.goal." + goalOptional.get().getId()); if (icon != null) { final SVGImage svgImage = icon.getSVGImage(); if (svgImage != null) { return icon.getSVGResource(); } } } return null; } }
@Inject private void registerIcons(IconRegistry iconRegistry, JavaResources resources) { // icon for category in Wizard iconRegistry.registerIcon( new Icon(Constants.JAVA_CATEGORY + ".samples.category.icon", resources.javaCategoryIcon())); } }
@Nullable @Override public SVGResource getTitleImage() { final VirtualFile file = getEditorInput().getFile(); if (file instanceof CommandFileNode) { final CommandImpl command = ((CommandFileNode) file).getData(); final Icon icon = iconRegistry.getIconIfExist("command.type." + command.getType()); if (icon != null) { final SVGImage svgImage = icon.getSVGImage(); if (svgImage != null) { return icon.getSVGResource(); } } } return input.getSVGResource(); }
@Inject private void prepareActions(NodeJsResources resources, IconRegistry iconRegistry) { iconRegistry.registerIcon( new Icon(NODE_JS_CATEGORY + ".samples.category.icon", resources.jsIcon())); } }
@Inject public NodeJsDebuggerConfigurationType( NodeJsDebuggerConfigurationPagePresenter page, IconRegistry iconRegistry, NodeJsDebuggerResources resources) { this.page = page; iconRegistry.registerIcon( new Icon( NodeJsDebugger.ID + ".debug.configuration.type.icon", resources.nodeJsDebugConfigurationType())); }
@Inject public GwtCheCommandType(PluginsResources resources, IconRegistry iconRegistry) { iconRegistry.registerIcon(new Icon("command.type." + ID, resources.gwtCheCommandType())); }
@Inject public DefaultIconsRegistrar(IconRegistry iconRegistry, Resources resources) { iconRegistry.registerIcon( new Icon( "default.projecttype.small.icon", "default/project.png", resources.defaultProject())); iconRegistry.registerIcon( new Icon("default.folder.small.icon", "default/folder.png", resources.defaultFolder())); iconRegistry.registerIcon( new Icon("default.file.small.icon", "default/file.png", resources.defaultFile())); iconRegistry.registerIcon(new Icon("default", "default/default.jpg", resources.defaultIcon())); } }
@Inject public JavaCommandType( JavaResources resources, JavaCommandPagePresenter page, CurrentProjectPathMacro currentProjectPathMacro, SourcepathMacro sourcepathMacro, OutputDirMacro outputDirMacro, ClasspathMacro classpathMacro, IconRegistry iconRegistry, JavaLocalizationConstant localizationConstants) { this.currentProjectPathMacro = currentProjectPathMacro; this.sourcepathMacro = sourcepathMacro; this.outputDirMacro = outputDirMacro; this.classpathMacro = classpathMacro; this.localizationConstants = localizationConstants; pages = new LinkedList<>(); pages.add(page); iconRegistry.registerIcon(new Icon("command.type." + ID, resources.javaCategoryIcon())); }
/** Instantiates {@link StandardComponentInitializer} an creates standard content. */ @Inject public StandardComponentInitializer( IconRegistry iconRegistry, MachineResources machineResources, StandardComponentInitializer.ParserResource parserResource) { iconRegistry.registerIcon( new Icon(BLANK_CATEGORY + ".samples.category.icon", parserResource.samplesCategoryBlank())); iconRegistry.registerIcon(new Icon("che.machine.icon", machineResources.devMachine())); machineResources.getCss().ensureInjected(); }