Java 类org.openide.util.ImageUtilities 实例源码

项目:incubator-netbeans    文件:BreakpointsViewButtons.java   
@NbBundle.Messages({"CTL_DeactivateAllBreakpoints=Deactivate all breakpoints in current session",
                    "CTL_ActivateAllBreakpoints=Activate all breakpoints in current session",
                    "CTL_NoDeactivation=The current session does not allow to deactivate breakpoints",
                    "CTL_NoSession=No debugger session"})
public static AbstractButton createActivateBreakpointsActionButton() {
    ImageIcon icon = ImageUtilities.loadImageIcon(DEACTIVATED_LINE_BREAKPOINT, false);
    final JToggleButton button = new JToggleButton(icon);
    // ensure small size, just for the icon
    Dimension size = new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    button.setPreferredSize(size);
    button.setMargin(new Insets(1, 1, 1, 1));
    button.setBorder(new EmptyBorder(button.getBorder().getBorderInsets(button)));
    button.setToolTipText(Bundle.CTL_DeactivateAllBreakpoints());
    button.setFocusable(false);
    final BreakpointsActivator ba = new BreakpointsActivator(button);
    button.addActionListener(ba);
    DebuggerManager.getDebuggerManager().addDebuggerListener(DebuggerManager.PROP_CURRENT_ENGINE, new DebuggerManagerAdapter() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            DebuggerEngine de = (DebuggerEngine) evt.getNewValue();
            ba.setCurrentEngine(de);
        }
    });
    ba.setCurrentEngine(DebuggerManager.getDebuggerManager().getCurrentEngine());
    return button;
}
项目:incubator-netbeans    文件:AbstractXMLNavigatorContent.java   
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();
}
项目:incubator-netbeans    文件:JFXProjectIconAnnotator.java   
/**
 * Gets the badge
 * @return badge or null if badge icon does not exist
 */
@NullUnknown
private Image getJFXBadge() {
    Image img = badgeCache.get();
    if (img == null) {
        if(!EventQueue.isDispatchThread()) {
            img = ImageUtilities.loadImage(JFX_BADGE_PATH);
            badgeCache.set(img);
        } else {
            final Runnable runLoadIcon = new Runnable() {
                @Override
                public void run() {            
                    badgeCache.set(ImageUtilities.loadImage(JFX_BADGE_PATH));
                    cs.fireChange();
                }
            };
            final RequestProcessor RP = new RequestProcessor(JFXProjectIconAnnotator.class.getName());
            RP.post(runLoadIcon);
        }
    }
    return img;
}
项目:incubator-netbeans    文件:InstallStep.java   
@Messages({
    "# {0} - plugin_name",
    "inBackground_WritePermission=You don''t have permission to install plugin {0} into the installation directory.",
    "inBackground_WritePermission_Details=details", "cancel=Cancel", "install=Install anyway"})
private void notifyWritePermissionProblem(final OperationException ex, final UpdateElement culprit) {
    // lack of privileges for writing
    ActionListener onMouseClickAction = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            ProblemPanel problem = new ProblemPanel(ex, culprit, false);
            problem.showWriteProblemDialog();
        }
    };
    String title = inBackground_WritePermission(culprit.getDisplayName());
    String description = inBackground_WritePermission_Details();
    NotificationDisplayer.getDefault().notify(title,
            ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/error.png", false), // NOI18N
            description, onMouseClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.ERROR);
}
项目:incubator-netbeans    文件:ValueItem.java   
@Override
protected ImageIcon getIcon() {
    if (icon != null) {
        return icon;
    }
    synchronized (cache) {
        icon = cache.get(iconResource);
    }
    if (icon == null) {
        icon = ImageUtilities.loadImageIcon(iconResource, false);
    }
    synchronized (cache) {
        cache.put(iconResource, icon);
    }
    return icon;
}
项目:incubator-netbeans    文件:TaskPanel.java   
@NbBundle.Messages({
    "IssuePanel.noSummary=Missing summary."
})
private void updateMessagePanel () {
    messagePanel.removeAll();
    if (noSummary) {
        JLabel noSummaryLabel = new JLabel();
        noSummaryLabel.setText(Bundle.IssuePanel_noSummary());
        String icon = "org/netbeans/modules/localtasks/resources/error.gif"; //NOI18N
        noSummaryLabel.setIcon(new ImageIcon(ImageUtilities.loadImage(icon)));
        messagePanel.add(noSummaryLabel);
    }
    if (noSummary) {
        messagePanel.setVisible(true);
        messagePanel.revalidate();
    } else {
        messagePanel.setVisible(false);
    }
}
项目:incubator-netbeans    文件:PersistenceLibraryPanel.java   
private void setErrorMessage(String msg, Boolean canContinue) {
    errorMessage.setForeground(nbErrorForeground);
    if (msg != null && msg.trim().length() > 0 && canContinue != null) {
        if (canContinue.booleanValue()) {
            errorMessage.setIcon(ImageUtilities.loadImageIcon(WARNING_GIF, false));
            errorMessage.setForeground(nbWarningForeground);
        } else {
            errorMessage.setIcon(ImageUtilities.loadImageIcon(ERROR_GIF, false));
        }
        errorMessage.setToolTipText(msg);
    } else {
        errorMessage.setIcon(null);
        errorMessage.setToolTipText(null);
    }

    errorMessage.setText(msg);
}
项目:incubator-netbeans    文件:TerminalSupportImpl.java   
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;
}
项目:incubator-netbeans    文件:CloseButtonFactory.java   
private static Icon getCloseTabPressedImage() {
    if( null == closeTabPressedImage ) {
        String path = UIManager.getString("nb.close.tab.icon.pressed.name" ); //NOI18N
        if( null != path ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon(path, true); // NOI18N
        }
    }
    if( null == closeTabPressedImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_pressed.png", true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_close_pressed.png", true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_close_pressed.png", true); // NOI18N
        } else if( isWindowsLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_close_pressed.png", true); // NOI18N
        } else if( isAquaLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_close_pressed.png", true); // NOI18N
        } else if( isGTKLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_close_pressed.png", true); // NOI18N
        } else {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/metal_close_pressed.png", true); // NOI18N
        }
    }
    return closeTabPressedImage;
}
项目:incubator-netbeans    文件:JavaCompletionItem.java   
@Override
protected ImageIcon getBaseIcon() {
    int level = getProtectionLevel(modifiers);
    ImageIcon cachedIcon = icon[level];
    if (cachedIcon != null) {
        return cachedIcon;
    }
    String iconPath = CONSTRUCTOR_PUBLIC;
    switch (level) {
        case PRIVATE_LEVEL:
            iconPath = CONSTRUCTOR_PRIVATE;
            break;
        case PACKAGE_LEVEL:
            iconPath = CONSTRUCTOR_PACKAGE;
            break;
        case PROTECTED_LEVEL:
            iconPath = CONSTRUCTOR_PROTECTED;
            break;
        case PUBLIC_LEVEL:
            iconPath = CONSTRUCTOR_PUBLIC;
            break;
    }
    ImageIcon newIcon = ImageUtilities.loadImageIcon(iconPath, false);
    icon[level] = newIcon;
    return newIcon;
}
项目:incubator-netbeans    文件:VCSAnnotationProviderTestCase.java   
private void startAnnotation(final Set<FileObject> files) {
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            lastEvent = System.currentTimeMillis();
            long time = System.currentTimeMillis();
            for (FileObject fo : files) {
                String name = fo.getNameExt();
                name = VersioningAnnotationProvider.getDefault().annotateNameHtml(name, Collections.singleton(fo));
                annotationsLabels.put(fo, name);
                Image image = ImageUtilities.assignToolTipToImage(VCSAnnotationProviderTestCase.IMAGE, fo.getNameExt());
                ImageUtilities.getImageToolTip(image);
                image = VersioningAnnotationProvider.getDefault().annotateIcon(image, 0, Collections.singleton(fo));
                annotationsIcons.put(fo, image);
            }
            time = System.currentTimeMillis() - time;
            if (time > 500) {
                ex = new Exception("Annotation takes more than 200ms");
            }
        }     
    });
}
项目:incubator-netbeans    文件:FiltersMenuButton.java   
/** Creates a new instance of FiltersMenuButton */
public FiltersMenuButton( TaskFilter currentFilter ) {
    super( ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/filter.png", false), ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/filter_rollover.png", false), 4 );  //NOI18N
    taskManager = TaskManagerImpl.getInstance();

    updateState( currentFilter );

    addActionListener( new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            if( !isSelected() ) {
                taskManager.observe( taskManager.getScope(), TaskFilter.EMPTY );
            } else {
                openFilterEditor();
                updateState( taskManager.getFilter() );
            }
        }
    });
}
项目:incubator-netbeans    文件:NavigatorContent.java   
/** Creates filter descriptions and filters itself */
private FiltersManager createFilters() {
    FiltersDescription desc = new FiltersDescription();

    desc.addFilter(ATTRIBUTES_FILTER,
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowAttributes"),     //NOI18N
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowAttributesTip"),     //NOI18N
            showAttributes, ImageUtilities.loadImageIcon("org/netbeans/modules/xml/text/navigator/resources/a.png", false), //NOI18N
            null
            );
    desc.addFilter(CONTENT_FILTER,
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowContent"),     //NOI18N
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowContentTip"),     //NOI18N
            showContent, ImageUtilities.loadImageIcon("org/netbeans/modules/xml/text/navigator/resources/content.png", false), //NOI18N
            null
            );

    return FiltersDescription.createManager(desc);
}
项目:incubator-netbeans    文件:UnitTab.java   
@Override
public Component getTableCellRendererComponent (
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    JLabel renderComponent = (JLabel)super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column);

    if (value instanceof Image) {
        Unit u = model.getUnitAtRow(table.convertRowIndexToModel(row));
        if (u instanceof Unit.Available) {
            Unit.Available a = (Unit.Available)u;
            renderComponent.setIcon(ImageUtilities.image2Icon(a.getSourceIcon()));
            renderComponent.setText ("");
            renderComponent.setHorizontalAlignment (SwingConstants.CENTER);
        }

    }
    Component retval = renderComponent;
    return retval;
}
项目:incubator-netbeans    文件:ViewComponent.java   
private void initComponents() {
    setLayout (new BorderLayout ());
    contentComponent = new javax.swing.JPanel(new BorderLayout ());
    add (contentComponent, BorderLayout.CENTER);  //NOI18N
    JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.setBorderPainted(true);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolBar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    toolBar.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.background")),
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.foreground"))));
    add(toolBar, BorderLayout.WEST);
    JComponent buttonsPane = toolBar;
    viewModelListener = new ViewModelListener (
        name,
        contentComponent,
        buttonsPane,
        propertiesHelpID,
        ImageUtilities.loadImage(icon)
    );
}
项目:incubator-netbeans    文件:ClassMemberFilters.java   
/** Creates filter descriptions and filters itself */
    private static FiltersManager createFilters () {
        FiltersDescription desc = new FiltersDescription();

        // XXX to be enabled later
//        desc.addFilter(SHOW_INHERITED,
//                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowInherited"),     //NOI18N
//                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowInheritedTip"),     //NOI18N
//                false,
//                new ImageIcon (Utilities.loadImage("org/netbeans/modules/csl/navigation/resources/filterHideInherited.png")), //NOI18N
//                null
//        );
        desc.addFilter(SHOW_FIELDS,
                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowFields"),     //NOI18N
                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowFieldsTip"),     //NOI18N
                true,
                new ImageIcon (ImageUtilities.loadImage("org/netbeans/modules/csl/navigation/resources/filterHideFields.gif")), //NOI18N
                null
        );
        desc.addFilter(SHOW_STATIC,
                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowStatic"),     //NOI18N
                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowStaticTip"),     //NOI18N
                true,
                new ImageIcon (ImageUtilities.loadImage("org/netbeans/modules/csl/navigation/resources/filterHideStatic.png")), //NOI18N
                null
        );
        desc.addFilter(SHOW_NON_PUBLIC,
                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowNonPublic"),     //NOI18N
                NbBundle.getMessage(ClassMemberFilters.class, "LBL_ShowNonPublicTip"),     //NOI18N
                true,
                new ImageIcon (ImageUtilities.loadImage("org/netbeans/modules/csl/navigation/resources/filterHideNonPublic.png")), //NOI18N
                null
        );

        return FiltersDescription.createManager(desc);
    }
项目:incubator-netbeans    文件:AutoupdateCatalogFactoryTest.java   
public void testCreateUpdateProviderWithOwnIcon() throws Exception {
    FileObject f = FileUtil.getConfigRoot().createData("whatever.instance");
    f.setAttribute("url", "file:/wherever.xml");
    f.setAttribute("displayName", "Whatever");
    f.setAttribute("category", "Jarda's Updates");
    f.setAttribute("iconBase", "org/netbeans/modules/autoupdate/services/resources/icon-standard.png");
    UpdateProvider up = AutoupdateCatalogFactory.createUpdateProvider(f);
    UpdateUnitProvider uup = Trampoline.API.createUpdateUnitProvider (new UpdateUnitProviderImpl (up));
    assertEquals("whatever", uup.getName());
    assertEquals("Whatever", uup.getDisplayName());
    assertEquals(new URL("file:/wherever.xml"), uup.getProviderURL());
    Image img = ImageUtilities.loadImage("org/netbeans/modules/autoupdate/services/resources/icon-standard.png");
    assertEquals("Icons are the same", img, uup.getSourceIcon());
}
项目:incubator-netbeans    文件:AbstractSearchResultsPanel.java   
private void initExpandButton() {
    sizeButton(btnExpand);
    btnExpand.setIcon(ImageUtilities.loadImageIcon(EXPAND_ICON, true));
    btnExpand.setSelectedIcon(ImageUtilities.loadImageIcon(
            COLLAPSE_ICON, true));
    btnExpand.setToolTipText(UiUtils.getText(
            "TEXT_BUTTON_EXPAND"));                                 //NOI18N
    btnExpand.setEnabled(false);
    btnExpand.setSelected(false);
}
项目:incubator-netbeans    文件:TestsuiteNode.java   
@Override
 public Image getIcon(int type) {
     if (report != null){
         Status status = report.getStatus();
         if (!report.isCompleted()){
             switch (status){
                 case FAILED:
                 case ERROR: return ImageUtilities.mergeImages(
                         ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/run.gif"), //NOI18N
                         ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/error-badge.gif"), //NOI18N
                         8, 8);
             }
         }else{
             switch (status){
                 case PASSED:
                     return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/ok_16.png"); //NOI18N
                 case PASSEDWITHERRORS:
                     return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/ok_withErrors_16.png"); //NOI18N
                 case FAILED:
                     return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/warning_16.png"); //NOI18N
                 case ERROR:
                     return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/error_16.png"); //NOI18N
   case ABORTED:
return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/aborted.png"); //NOI18N
   case SKIPPED:
return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/skipped_16.png"); //NOI18N
                 default:
                     return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/warning2_16.png"); //NOI18N
             }
         }
     }
     return ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/resources/run.gif"); //NOI18N
 }
项目:incubator-netbeans    文件:ErrorNode.java   
public ErrorNode(String text, Action refreshAction) {
    super(null);
    this.defaultAction = refreshAction;
    btnRefresh = new LinkButton(NbBundle.getMessage(ErrorNode.class, "LBL_Retry"), refreshAction); //NOI18N
    lblMessage = new TreeLabel(text);
    lblMessage.setIcon(new ImageIcon(ImageUtilities.loadImage("org/netbeans/modules/bugtracking/tasks/resources/error.png"))); //NOI18N
}
项目:incubator-netbeans    文件:ProjectsView.java   
@Override
public Image getIcon(int type) {
    Icon icon = info.getIcon();
    if (icon == null) {
        Logger.getLogger(ProjectsView.class.getName()).log(Level.WARNING, "Null project icon for {0}:{1}", //NOI18N
                new Object[] { info.getDisplayName(), info.getProject() });
        return getFolderIcon();
    } else {
        return ImageUtilities.icon2Image(icon);
    }
}
项目:incubator-netbeans    文件:SimpleClassItem.java   
@Override
protected ImageIcon getIcon() {
    if (ICON == null) {
        ICON = ImageUtilities.loadImageIcon(ICON_CLASS, false);
    }
    return ICON;
}
项目:NBANDROID-V2    文件:PlatformNode.java   
private List<SourceGroup> getKeys() {
    AndroidClassPath cpProvider
            = ((PlatformNode) getNode()).project.getLookup().lookup(AndroidClassPath.class);
    if (cpProvider == null) {
        return Collections.emptyList();
    }
    //Todo: Should listen on returned classpath, but now the bootstrap libraries are read only
    FileObject[] roots = cpProvider.getClassPath(ClassPath.BOOT).getRoots();
    List<SourceGroup> result = new ArrayList<>(roots.length);
    for (FileObject root : roots) {
        if (GradleAndroidClassPathProvider.VIRTUALJAVA8ROOT_DIR.getPath().equals(root.getPath())) {
            continue;
        }
        FileObject file;
        Icon icon;
        Icon openedIcon;
        if ("jar".equals(root.toURL().getProtocol())) {
            //NOI18N
            file = FileUtil.getArchiveFile(root);
            icon = openedIcon = new ImageIcon(ImageUtilities.loadImage(ARCHIVE_ICON));
        } else {
            file = root;
            icon = null;
            openedIcon = null;
        }
        if (file.isValid()) {
            result.add(new LibrariesSourceGroup(root, file.getNameExt(), icon, openedIcon));
        }
    }
    return result;
}
项目:incubator-netbeans    文件:EditorActionUtilities.java   
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;
}
项目:incubator-netbeans    文件:ClassesCountsView.java   
/**
 * Creates a new instance of ClassesCountsView
 */
public ClassesCountsView () {
    setIcon (ImageUtilities.loadImage ("org/netbeans/modules/debugger/resources/classesView/Classes.png")); // NOI18N
    setLayout (new BorderLayout ());
    // Remember the location of the component when closed.
    putClientProperty("KeepNonPersistentTCInModelWhenClosed", Boolean.TRUE); // NOI18N
}
项目:incubator-netbeans    文件:LogicalViewProviders.java   
@Override
public Image getIcon(int type) {
    final Icon icon = info.getIcon();
    final Image img = icon == null ?
        super.getIcon(type) :
        ImageUtilities.icon2Image(icon);
    return !broken && compileOnSaveDisabled ?
        ImageUtilities.mergeImages(img, compileOnSaveDisabledBadge, 8, 0) :
        img;
}
项目:incubator-netbeans    文件:ImageDataLoaderBeanInfo.java   
public Image getIcon(final int type) {
    if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) ||
            (type == java.beans.BeanInfo.ICON_MONO_16x16)) {
        return ImageUtilities.loadImage("org/netbeans/modules/image/imageObject.png"); // NOI18N
    } else {
        return ImageUtilities.loadImage ("org/netbeans/modules/image/imageObject32.gif"); // NOI18N
    }
}
项目:incubator-netbeans    文件:VisualizerNodeTest.java   
public void testNodeToolTip() {
    AbstractNode n = new AbstractNode(Children.LEAF) {



        @Override
        public Image getIcon(int type) {
            return ImageUtilities.assignToolTipToImage(super.getIcon(type), "test");
        }

    };
    VisualizerNode vn = (VisualizerNode) Visualizer.findVisualizer(n);
    assertEquals(vn.getShortDescription(), "<html><br>test</html>");
}
项目:incubator-netbeans    文件:NavigatorTreeCellRenderer.java   
private ImageIcon getImageIcon(String name, boolean error){
    ImageIcon icon = ImageUtilities.loadImageIcon(name, false);
    if(error)
        return new ImageIcon(ImageUtilities.mergeImages( icon.getImage(), ERROR_IMAGE, 15, 7 ));
    else
        return icon;
}
项目:incubator-netbeans    文件:DelegatingScopeProvider.java   
private DelegatingScopeProvider(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
}
项目:incubator-netbeans    文件:RepositoryBrowserPanel.java   
private Image findIcon (String key) {
    Object obj = UIManager.get(key);
    if (obj instanceof Image) {
        return (Image)obj;
    }

    if (obj instanceof Icon) {
        Icon icon = (Icon)obj;
        return ImageUtilities.icon2Image(icon);
    }

    return null;
}
项目:incubator-netbeans    文件:DependenciesNode.java   
@Override
public Image getIcon(int param) {
    Image retValue = ImageUtilities.mergeImages(getTreeFolderIcon(false),
            ImageUtilities.loadImage(LIBS_BADGE), //NOI18N
            8, 8);
    return retValue;
}
项目:incubator-netbeans    文件:ProjectNode.java   
@Override
public Image getIcon(int type) {
    if (cachedIcon == null) {
        ProjectInformation info = getProjectInformation();
        if (info != null) {
            Icon icon = info.getIcon();
            cachedIcon = ImageUtilities.icon2Image(icon);
        }
        else {
            cachedIcon = ImageUtilities.loadImage(PROJECT_ICON);
        }
    }
    return cachedIcon;
}
项目:incubator-netbeans    文件:CustomizerPane.java   
private void setErrorMessage(String errMessage, boolean valid) {
    customizerPanel.remove(errorPanel);
    if (errMessage != null && !errMessage.trim().isEmpty()) {
        errorIcon.setIcon(ImageUtilities.loadImageIcon(valid ? "org/netbeans/modules/dialogs/warning.gif" : "org/netbeans/modules/dialogs/error.gif", true));
        errorMessageValue.setText(errMessage);
        errorMessageValue.setForeground(UIManager.getColor(valid ? "nb.warningForeground" : "nb.errorForeground")); // NOI18N
        customizerPanel.add(errorPanel, errMessConstraints);
    }
    customizerPanel.revalidate();
    customizerPanel.repaint();
}
项目:incubator-netbeans    文件:TerminalSettingsAction.java   
private static JButton createButton(String iconPath, String tooltip) {
    Icon icon = ImageUtilities.loadImageIcon(iconPath, false);
    final JButton button = new JButton(icon);
    // ensure small size, just for the icon
    Dimension size = new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    button.setPreferredSize(size);
    button.setMargin(new Insets(1, 1, 1, 1));
    button.setBorder(new EmptyBorder(button.getBorder().getBorderInsets(button)));
    button.setToolTipText(tooltip);
    button.setFocusable(false);
    return button;
}
项目:NBANDROID-V2    文件:LogTopComponent.java   
public LogTopComponent() {
        initComponents();
        setName(NbBundle.getMessage(LogTopComponent.class, "CTL_LogTopComponent"));
        setToolTipText(NbBundle.getMessage(LogTopComponent.class, "HINT_LogTopComponent"));
        setIcon(ImageUtilities.loadImage(ICON_PATH, true));
//        putClientProperty(TopComponent.PROP_KEEP_PREFERRED_SIZE_WHEN_SLIDED_IN, Boolean.TRUE);
        myInit();
//        selectedTable = jTable1;
    }
项目:MaxSim    文件:BytecodeNode.java   
@Override
public Image getIcon(int i) {
    if (nodes != null) {
        return ImageUtilities.loadImage("com/sun/hotspot/igv/bytecodes/images/link.png");
    } else {
        return ImageUtilities.loadImage("com/sun/hotspot/igv/bytecodes/images/bytecode.png");
    }
}
项目:incubator-netbeans    文件:FakeJiraConnector.java   
/**
 * Returns a fake {@link BugtrackingConnector} to be shown in the create
 * repository dialog. The repository controller panel notifies a the missing
 * JIRA plugin and comes with a button to download it from the Update Center.
 *
 * @return
 */
public static synchronized DelegatingConnector getConnector() {
    if(connector == null) {
        connector =  new DelegatingConnector(
                new JiraProxyConnector(), 
                "fake.jira.connector",                                              // NOI18N
                NbBundle.getMessage(FakeJiraConnector.class, "LBL_FakeJiraName"),         // NOI18N
                NbBundle.getMessage(FakeJiraConnector.class, "LBL_FakeJiraNameTooltip"),  // NOI18N
                ImageUtilities.loadImage("org/netbeans/modules/bugtracking/ui/resources/repository.png", true));
    }
    return connector;
}
项目:incubator-netbeans    文件:OptionsCategory.java   
/**
 * Returns 32x32 icon used in list on the top of
 * Options Dialog.
 *
 * @return 32x32 icon
 */
public Icon getIcon () {
    Icon res = ImageUtilities.loadImageIcon (getIconBase () + ".png", true);
    if (res == null)
        res = ImageUtilities.loadImageIcon( getIconBase () + ".gif", true);
    return res;
    }
项目:incubator-netbeans    文件:MimeFactory.java   
final Image getImage(int type) {
    if (img == null && fo != null) {
        img = ImageUtilities.loadImage("org/openide/loaders/empty.gif", true); // NOI18N
        try {
            img = FileUIUtils.getImageDecorator(fo.getFileSystem()).annotateIcon(img, type, Collections.singleton(fo));
        } catch (FileStateInvalidException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
    return img;
}