Java Code Examples for org.openide.util.ImageUtilities#loadImageIcon()
The following examples show how to use
org.openide.util.ImageUtilities#loadImageIcon() .
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: AbstractXMLNavigatorContent.java From netbeans with Apache License 2.0 | 6 votes |
public void showWaitPanel() { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (!isLoading()) { return; } showWaitPanel(); } }); } removeAll(); if (waitIcon == null) { waitIcon = ImageUtilities.loadImageIcon("org/netbeans/modules/xml/text/navigator/resources/wait.gif", false); //NOI18N } msgLabel.setIcon(waitIcon); msgLabel.setHorizontalAlignment(SwingConstants.LEFT); msgLabel.setForeground(Color.BLACK); msgLabel.setText(NbBundle.getMessage(AbstractXMLNavigatorContent.class, "LBL_Wait")); add(emptyPanel, BorderLayout.NORTH); revalidate(); repaint(); }
Example 2
Source File: TerminalSupportImpl.java From netbeans with Apache License 2.0 | 6 votes |
public static Component getToolbarPresenter(Action action) { JButton button = new JButton(action); button.setBorderPainted(false); button.setOpaque(false); button.setText(null); button.putClientProperty("hideActionText", Boolean.TRUE); // NOI18N Object icon = action.getValue(Action.SMALL_ICON); if (icon == null) { icon = ImageUtilities.loadImageIcon("org/netbeans/modules/dlight/terminal/action/local_term.png", false);// NOI18N } if (!(icon instanceof Icon)) { throw new IllegalStateException("No icon provided for " + action); // NOI18N } button.setDisabledIcon(ImageUtilities.createDisabledIcon((Icon) icon)); return button; }
Example 3
Source File: NativeExecutionUserNotificationImpl.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void showErrorNotification(String title, String shortText, String longText) { ImageIcon icon = ImageUtilities.loadImageIcon("org/netbeans/modules/nativeexecution/impl/error.png", false); //NOI18N longText = "<html>" + longText + "</html>"; // NOI18N NotificationDisplayer.getDefault().notify(title, icon, new JLabel(shortText), new JLabel(longText), NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.ERROR); }
Example 4
Source File: CompletionItem.java From netbeans with Apache License 2.0 | 5 votes |
@Override public ImageIcon getIcon() { if (isGroovy) { if (groovyIcon == null) { groovyIcon = ImageUtilities.loadImageIcon(GroovySources.GROOVY_FILE_ICON_16x16, false); } return groovyIcon; } else { if (javaIcon == null) { javaIcon = ImageUtilities.loadImageIcon(JAVA_KEYWORD, false); } return javaIcon; } }
Example 5
Source File: Actions.java From netbeans with Apache License 2.0 | 5 votes |
static ImageIcon loadImage(String iconBase, boolean useSmallIcon, String suffix) { if (!useSmallIcon) { String bigBase = insertBeforeSuffix(iconBase, "24"); // NOI18N ImageIcon icon = ImageUtilities.loadImageIcon(insertBeforeSuffix(bigBase, suffix), true); if (icon != null) { return icon; } } return ImageUtilities.loadImageIcon(insertBeforeSuffix(iconBase, suffix), true); // NOI18N }
Example 6
Source File: CompletionItem.java From netbeans with Apache License 2.0 | 5 votes |
@Override public ImageIcon getIcon() { if (!isGDK) { return (ImageIcon) ElementIcons.getElementIcon(javax.lang.model.element.ElementKind.METHOD, Utilities.reflectionModifiersToModel(method.getModifiers())); } if (groovyIcon == null) { groovyIcon = ImageUtilities.loadImageIcon(GroovySources.GROOVY_FILE_ICON_16x16, false); } return groovyIcon; }
Example 7
Source File: YamlCompletion.java From netbeans with Apache License 2.0 | 5 votes |
@Override public ImageIcon getIcon() { if (keywordIcon == null) { keywordIcon = ImageUtilities.loadImageIcon(YAML_KEYWORD, false); } return keywordIcon; }
Example 8
Source File: DelegatingCustomScopeProvider.java From netbeans with Apache License 2.0 | 5 votes |
private DelegatingCustomScopeProvider(Map<?, ?> map) { this.map = map; String path = (String) map.get("iconBase"); //NOI18N icon = path != null && !path.equals("") ? ImageUtilities.loadImageIcon(path, false) : null; id = (String) map.get("id"); //NOI18N displayName = (String) map.get("displayName"); //NOI18N position = (Integer) map.get("position"); //NOI18N }
Example 9
Source File: RunCustomMavenAction.java From netbeans with Apache License 2.0 | 5 votes |
public static Icon actionDeclarationIcon(String action) { String s = actionDeclarationIconPath(action); if (s != null) { return ImageUtilities.loadImageIcon(s, false); } return null; }
Example 10
Source File: ActionsTest.java From netbeans with Apache License 2.0 | 5 votes |
/** * Tests that "unknownIcon" is used if no iconBase */ public void testToggleButtonUnknownIcon() throws Exception { AbstractButton b = new AlwaysEnabledAction.DefaultIconToggleButton(); Action action = new TestAction(); action.putValue("iconBase", null); Actions.connect(b, action); Icon icon = b.getIcon(); assertNotNull("null ToggleButton icon", icon); Icon expectedIcon = ImageUtilities.loadImageIcon("org/openide/awt/resources/unknown.gif", false); //NOI18N assertEquals("unkownIcon not used", expectedIcon, icon); }
Example 11
Source File: EditorActionUtilities.java From netbeans with Apache License 2.0 | 5 votes |
public static Icon createLargeIcon(Action a) { String iconBase = (String) a.getValue(AbstractEditorAction.ICON_RESOURCE_KEY); if (iconBase != null) { iconBase += LARGE_ICON_SIZE_STRING; return ImageUtilities.loadImageIcon(iconBase, true); } return null; }
Example 12
Source File: JPACompletionItem.java From netbeans with Apache License 2.0 | 4 votes |
@Override protected ImageIcon getIcon() { return ImageUtilities.loadImageIcon(FIELD_ICON, false); }
Example 13
Source File: WhereUsedPanel.java From netbeans with Apache License 2.0 | 4 votes |
private void setupScope() { final FileObject fo = element.getFileObject(); final String packageName = element.getOwnerNameWithoutPackage(); final Project p = FileOwnerQuery.getOwner(fo); final ClassPath classPath = ClassPath.getClassPath(fo, ClassPath.SOURCE); if (classPath != null) { if(packageName == null) { packageFolder = classPath.findOwnerRoot(fo); } else { packageFolder = classPath.findResource(packageName.replaceAll("\\.", "/")); //NOI18N } } final JLabel customScope; final JLabel currentFile; final JLabel currentPackage; final JLabel currentProject; final JLabel allProjects; if (p != null) { ProjectInformation pi = ProjectUtils.getInformation(FileOwnerQuery.getOwner(fo)); DataObject currentFileDo = null; try { currentFileDo = DataObject.find(fo); } catch (DataObjectNotFoundException ex) { } // Not important, only for Icon. customScope = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CustomScope"), pi.getIcon(), SwingConstants.LEFT); //NOI18N currentFile = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CurrentFile", fo.getNameExt()), currentFileDo != null ? new ImageIcon(currentFileDo.getNodeDelegate().getIcon(BeanInfo.ICON_COLOR_16x16)) : pi.getIcon(), SwingConstants.LEFT); //NOI18N currentPackage = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CurrentPackage", packageName), ImageUtilities.loadImageIcon(PACKAGE, false), SwingConstants.LEFT); //NOI18N currentProject = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CurrentProject", pi.getDisplayName()), pi.getIcon(), SwingConstants.LEFT); //NOI18N allProjects = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_AllProjects"), pi.getIcon(), SwingConstants.LEFT); //NOI18N } else { customScope = null; currentFile = null; currentPackage = null; currentProject = null; allProjects = null; } if ((element.getKind().equals(ElementKind.VARIABLE) || element.getKind().equals(ElementKind.PARAMETER)) || element.getModifiers().contains(Modifier.PRIVATE)) { enableScope = false; } innerPanel.removeAll(); innerPanel.add(panel, BorderLayout.CENTER); panel.setVisible(true); if(enableScope && currentProject != null) { scope.setModel(new DefaultComboBoxModel(new Object[]{allProjects, currentProject, currentPackage, currentFile, customScope })); int defaultItem = (Integer) RefactoringModule.getOption("whereUsed.scope", 0); // NOI18N WhereUsedPanel.this.customScope = readScope(); if(defaultItem == 4 && WhereUsedPanel.this.customScope !=null && WhereUsedPanel.this.customScope.getFiles().isEmpty() && WhereUsedPanel.this.customScope.getFolders().isEmpty() && WhereUsedPanel.this.customScope.getSourceRoots().isEmpty()) { scope.setSelectedIndex(0); } else { scope.setSelectedIndex(defaultItem); } scope.setRenderer(new JLabelRenderer()); } else { scopePanel.setVisible(false); } }
Example 14
Source File: FeatureProjectFactory.java From netbeans with Apache License 2.0 | 4 votes |
static Icon loadIcon() { return ImageUtilities.loadImageIcon( "org/netbeans/modules/ide/ergonomics/fod/project.png" // NOI18N , false ); }
Example 15
Source File: Icons.java From netbeans with Apache License 2.0 | 4 votes |
public static ImageIcon getElementIcon( ElementKind elementKind, Collection<Modifier> modifiers ) { if ( modifiers == null ) { modifiers = Collections.<Modifier>emptyList(); } ImageIcon icon = null; switch( elementKind ) { case MODULE: icon = ImageUtilities.loadImageIcon(ICON_BASE + "module" + PNG_EXTENSION, false ); break; case PACKAGE: icon = ImageUtilities.loadImageIcon(ICON_BASE + "package" + GIF_EXTENSION, false ); break; case ENUM: icon = ImageUtilities.loadImageIcon( ICON_BASE + "enum" + PNG_EXTENSION, false ); break; case ANNOTATION_TYPE: icon = ImageUtilities.loadImageIcon( ICON_BASE + "annotation" + PNG_EXTENSION, false ); break; case CLASS: icon = ImageUtilities.loadImageIcon( ICON_BASE + "class" + PNG_EXTENSION, false ); break; case INTERFACE: icon = ImageUtilities.loadImageIcon( ICON_BASE + "interface" + PNG_EXTENSION, false ); break; case FIELD: icon = ImageUtilities.loadImageIcon(getIconName(elementKind, ICON_BASE + "field", PNG_EXTENSION, modifiers ), false ); break; case ENUM_CONSTANT: icon = ImageUtilities.loadImageIcon(ICON_BASE + "constant" + PNG_EXTENSION, false ); break; case CONSTRUCTOR: icon = ImageUtilities.loadImageIcon(getIconName(elementKind, ICON_BASE + "constructor", PNG_EXTENSION, modifiers ), false ); break; case INSTANCE_INIT: case STATIC_INIT: icon = ImageUtilities.loadImageIcon(getIconName(elementKind, ICON_BASE + "initializer", PNG_EXTENSION, modifiers ), false ); break; case METHOD: icon = ImageUtilities.loadImageIcon(getIconName(elementKind, ICON_BASE + "method", PNG_EXTENSION, modifiers ), false ); break; default: if (elementKind.name().equals("RECORD")) { icon = ImageUtilities.loadImageIcon(ICON_BASE + "record" + PNG_EXTENSION, false); break; } if (elementKind.name().equals("STATE_COMPONENT")) { icon = ImageUtilities.loadImageIcon(ICON_BASE + "stateComponent" + PNG_EXTENSION, false); break; } icon = null; } return icon; }
Example 16
Source File: VariablesViewButtons.java From netbeans with Apache License 2.0 | 4 votes |
private static Icon loadIcon(String iconPath) { return ImageUtilities.loadImageIcon(iconPath, false); }
Example 17
Source File: SimpleIO.java From netbeans with Apache License 2.0 | 4 votes |
public CancelAction() { super(NbBundle.getMessage(SimpleIO.class, "CTL_Cancel"),ImageUtilities.loadImageIcon(ICON, false)); // NOI18N putValue(SHORT_DESCRIPTION, NbBundle.getMessage(SimpleIO.class, "LBL_CancelDesc")); // NOI18N }
Example 18
Source File: RemoteTerminalAction.java From netbeans with Apache License 2.0 | 4 votes |
public RemoteTerminalAction() { super("RemoteTerminalAction", NbBundle.getMessage(RemoteTerminalAction.class, "RemoteTerminalShortDescr"), // NOI18N ImageUtilities.loadImageIcon("org/netbeans/modules/dlight/terminal/action/remote_term.png", false)); // NOI18N cfgPanel = new RemoteInfoDialog(System.getProperty("user.name")); }
Example 19
Source File: GoToComponentItem.java From cakephp3-netbeans with Apache License 2.0 | 4 votes |
@Override public Icon getIcon() { return ImageUtilities.loadImageIcon(CakePHP3Constants.GOTO_COMPONENT_ICON, true); }
Example 20
Source File: AbstractGradleExecutor.java From netbeans with Apache License 2.0 | 4 votes |
@NbBundle.Messages("LBL_OptionsAction=Gradle Settings") public OptionsAction() { super(LBL_OptionsAction(), ImageUtilities.loadImageIcon("org/netbeans/modules/gradle/resources/options.png", true)); putValue(Action.SHORT_DESCRIPTION, LBL_OptionsAction()); }