org.eclipse.lsp4j.ParameterInformation#org.openide.util.ImageUtilities源码实例Demo

下面列出了org.eclipse.lsp4j.ParameterInformation#org.openide.util.ImageUtilities 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: AmazonJ2EEInstanceNode.java
private Image badgeIcon(Image origImg) {
    Image badge = null;        
    switch (aij.getState()) {
        case UPDATING:
        case LAUNCHING:
        case TERMINATING:
            badge = ImageUtilities.loadImage(WAITING_ICON);
            break;
        case READY:
            badge = ImageUtilities.loadImage(RUNNING_ICON);
            break;
        case TERMINATED:
            badge = ImageUtilities.loadImage(TERMINATED_ICON);
            break;
    }
    return badge != null ? ImageUtilities.mergeImages(origImg, badge, 15, 8) : origImg;
}
 
源代码2 项目: netbeans   文件: LibrariesNode.java
private static SourceGroup createFileSourceGroup (File file, Collection<? super URL> rootsList) {
    Icon icon;
    Icon openedIcon;
    String displayName;
    final URL url = FileUtil.urlForArchiveOrDir(file);
    if (url == null) {
        return null;
    }
    else if ("jar".equals(url.getProtocol())) {  //NOI18N
        icon = openedIcon = ImageUtilities.loadImageIcon(ARCHIVE_ICON, false);
        displayName = file.getName();
    }
    else {                                
        icon = getFolderIcon (false);
        openedIcon = getFolderIcon (true);
        displayName = file.getAbsolutePath();
    }
    rootsList.add (url);
    FileObject root = URLMapper.findFileObject (url);
    if (root != null) {
        return new LibrariesSourceGroup (root,displayName,icon,openedIcon);
    }
    return null;
}
 
源代码3 项目: netbeans   文件: PlatformNode.java
private List<SourceGroup> getKeys() {
    JavaPlatform platform = ((PlatformNode)this.getNode()).pp.getPlatform();
    if (platform == null) {
        return Collections.emptyList();
    }
    //Todo: Should listen on returned classpath, but now the bootstrap libraries are read only
    FileObject[] roots = platform.getBootstrapLibraries().getRoots();
    List<SourceGroup> result = new ArrayList<SourceGroup>(roots.length);
    for (int i=0; i<roots.length; i++) {
            FileObject file;
            Icon icon;
            if ("jar".equals(roots[i].toURL().getProtocol())) { //NOI18N
                file = FileUtil.getArchiveFile(roots[i]);
                icon = ImageUtilities.loadImageIcon(ARCHIVE_ICON, false);
            } else {
                file = roots[i];
                icon = null;
            }
            if (file.isValid()) {
                result.add(new LibrariesSourceGroup(roots[i], file.getNameExt(), icon, icon));
            }
    }
    return result;
}
 
源代码4 项目: netbeans   文件: PackageDisplayUtils.java
public static Image getIcon(
        @NonNull final FileObject pkg,
        final boolean empty,
        @NonNull Callable<Accessibility> accessibilityProvider) {
    if ( empty ) {
        return ImageUtilities.loadImage(PACKAGE_EMPTY);
    } else {
        Accessibility a;
        try {
            a = pkg.isValid() ?  accessibilityProvider.call() : Accessibility.UNKNOWN;
        } catch (Exception e) {
            a = Accessibility.UNKNOWN;
        }
        switch (a) {
            case EXPORTED:
                return ImageUtilities.loadImage(PACKAGE_PUBLIC);
            case PRIVATE:
                return ImageUtilities.loadImage(PACKAGE_PRIVATE);
            case UNKNOWN:
                return ImageUtilities.loadImage(PACKAGE);
            default:
                throw new IllegalStateException(String.valueOf(a));
        }
    }
}
 
源代码5 项目: netbeans   文件: InstallationManager.java
@NbBundle.Messages({
    "NotifyMultipleInstallations.title=Multiple MySQL installations found",
    "NotifyMultipleInstallations.text=Select the installation to use"
})
private static void notifyAboutMultipleInstallations() {
    NotificationDisplayer.getDefault().notify(
            Bundle.NotifyMultipleInstallations_title(),
            ImageUtilities.loadImageIcon(ICON_BASE, false),
            Bundle.NotifyMultipleInstallations_text(),
            new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            SelectInstallationPanel.showSelectInstallationDialog();
        }
    }, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.WARNING);
}
 
源代码6 项目: netbeans   文件: AntProjectNode.java
private Image getBasicIcon() {
    AntProjectCookie.ParseStatus cookie = getCookie(AntProjectCookie.ParseStatus.class);
    if (cookie.getFile() == null && cookie.getFileObject() == null) {
        // Script has been invalidated perhaps? Don't continue, we would
        // just get an NPE from the getParseException.
        return ImageUtilities.loadImage("org/apache/tools/ant/module/resources/AntIconError.gif"); // NOI18N
    }
    if (!cookie.isParsed()) {
        // Assume for now it is not erroneous.
        return ImageUtilities.loadImage("org/apache/tools/ant/module/resources/AntIcon.gif"); // NOI18N
    }
    Throwable exc = cookie.getParseException();
    if (exc != null) {
        return ImageUtilities.loadImage("org/apache/tools/ant/module/resources/AntIconError.gif"); // NOI18N
    } else {
        return ImageUtilities.loadImage("org/apache/tools/ant/module/resources/AntIcon.gif"); // NOI18N
    }
}
 
源代码7 项目: netbeans   文件: ServiceTabProcessorTest.java
@Test
public void testNodesGeneratedCorrectly() throws Exception {
    Collection<? extends Node> arr = Lookups.forPath("UI/Runtime").lookupAll(Node.class);
    assertEquals("One node is there: " + arr, 1, arr.size());
    Node n = arr.iterator().next();

    assertEquals("my1", n.getName());
    assertEquals("disp1", n.getDisplayName());
    assertEquals("By default short description delegates to displayName", n.getDisplayName(), n.getShortDescription());

    Image img1 = ImageUtilities.loadImage("org/netbeans/core/ide/TestIcon1.png");
    Image img2 = ImageUtilities.loadImage("org/netbeans/core/ide/TestIcon2.png");

    assertSame("icon1 is in use", img1, n.getIcon(BeanInfo.ICON_COLOR_16x16));

    Node[] subNodes = n.getChildren().getNodes(true);
    assertEquals("Two subnodes", 2, subNodes.length);

    // now everything is initialized

    assertEquals("my2", n.getName());
    assertEquals("disp2", n.getDisplayName());
    assertEquals("short2", n.getShortDescription());
    assertSame("icon2 is in use", img2, n.getIcon(BeanInfo.ICON_COLOR_16x16));

}
 
源代码8 项目: netbeans   文件: ElementIcons.java
/**
 * Returns an icon for the given {@link ModuleElement.DirectiveKind}.
 * @param kind the {@link ModuleElement.DirectiveKind} to return an icon for.
 * @return the icon
 * @since 1.45
 */
public static Icon getModuleDirectiveIcon(@NonNull final ModuleElement.DirectiveKind kind) {
    Parameters.notNull("kind", kind);   //NOI18N
    switch (kind) {
        case EXPORTS:
            return ImageUtilities.loadImageIcon(EXPORTS_ICON, true);
        case REQUIRES:
            return ImageUtilities.loadImageIcon(REQUIRES_ICON, true);
        case USES:
            return ImageUtilities.loadImageIcon(USES_ICON, true);
        case PROVIDES:
            return ImageUtilities.loadImageIcon(PROVIDES_ICON, true);
        case OPENS:
            return ImageUtilities.loadImageIcon(OPENS_ICON, true);
        default:
            throw new IllegalArgumentException(kind.toString());
    }
}
 
源代码9 项目: visualvm   文件: IdeSnapshot.java
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    String methodName = method.getName();
    if (DECORABLE_SETNAME_METHOD.equals(methodName)) {
        recInfo.setName((String) args[0]);
    }
    if (DECORABLE_SETDISPLAYNAME_METHOD.equals(methodName)) {
        recInfo.setDisplayName((String) args[0]);
    }
    if (DECORABLE_SETSHORTDESCRIPTOR_METHOD.equals(methodName)) {
        recInfo.setToolTip((String) args[0]);
    }
    if (DECORABLE_SETICONBASE_METHOD.equals(methodName)) {
        String iconBase = (String) args[0];
        recInfo.setIcon(ImageUtilities.loadImageIcon(iconBase, true));
    }
    return null;
}
 
源代码10 项目: netbeans   文件: ClientSideProjectLogicalView.java
private Image annotateImage(Image image) {
    Image icon = image;
    boolean badged = false;
    // platform providers
    for (PlatformProvider provider : project.getPlatformProviders()) {
        BadgeIcon badgeIcon = provider.getBadgeIcon();
        if (badgeIcon != null) {
            icon = ImageUtilities.addToolTipToImage(icon, String.format(ICON_TOOLTIP, badgeIcon.getUrl(), provider.getDisplayName()));
            if (!badged) {
                icon = ImageUtilities.mergeImages(icon, badgeIcon.getImage(), 0, 0);
                badged = true;
            }
        } else {
            icon = ImageUtilities.addToolTipToImage(icon, String.format(ICON_TOOLTIP, PLACEHOLDER_BADGE_URL, provider.getDisplayName()));
        }
    }
    // project type, only if no platform
    if (!badged) {
        Image projectBadge = ImageUtilities.loadImage(project.isJsLibrary() ? JS_LIBRARY_BADGE_ICON : HTML5_BADGE_ICON);
        icon = ImageUtilities.mergeImages(icon, projectBadge, 0, 0);
    }
    return icon;
}
 
源代码11 项目: netbeans   文件: VariablesViewButtons.java
private static JToggleButton createToggleButton (final String id, String iconPath, String tooltip) {
    Icon icon = ImageUtilities.loadImageIcon(iconPath, false);
    boolean isSelected = isButtonSelected(id);
    final JToggleButton toggleButton = new JToggleButton(icon, isSelected);
    // ensure small size, just for the icon
    Dimension size = new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    toggleButton.setPreferredSize(size);
    toggleButton.setMargin(new Insets(1, 1, 1, 1));
    if (!"Aqua".equals(UIManager.getLookAndFeel().getID())) { //NOI18N
        // We do not want an ugly border with the exception of Mac, where it paints the toggle state!
        toggleButton.setBorder(new EmptyBorder(toggleButton.getBorder().getBorderInsets(toggleButton)));
    }
    toggleButton.setToolTipText(tooltip);
    toggleButton.setFocusable(false);
    return toggleButton;
}
 
源代码12 项目: netbeans   文件: MainProjectScanningScope.java
/**
 * @return New instance of MainProjectScanningScope
 */
public static MainProjectScanningScope create() {
    return new MainProjectScanningScope(
            NbBundle.getBundle( MainProjectScanningScope.class ).getString( "LBL_MainProjectScope" ), //NOI18N
            NbBundle.getBundle( MainProjectScanningScope.class ).getString( "HINT_MainProjectScope" ), //NOI18N
            ImageUtilities.loadImage( "org/netbeans/modules/tasklist/projectint/main_project_scope.png" ) //NOI18N
            );
}
 
源代码13 项目: netbeans   文件: MethodsFeatureModes.java
protected Icon getAddIcon() {
    String iconMask = LanguageIcons.CLASS;
    Image baseIcon = Icons.getImage(iconMask);
    Image addBadge = Icons.getImage(GeneralIcons.BADGE_ADD);
    Image addImage = ImageUtilities.mergeImages(baseIcon, addBadge, 0, 0);
    return ImageUtilities.image2Icon(addImage);
}
 
源代码14 项目: netbeans   文件: DependenciesNode.java
@Override
public Image getIcon(int param) {
    Image retValue = ImageUtilities.mergeImages(getTreeFolderIcon(false),
            ImageUtilities.loadImage(LIBS_BADGE), //NOI18N
            8, 8);
    return retValue;
}
 
源代码15 项目: netbeans   文件: BookmarkNode.java
@Override
public Image getIcon(int type) {
    if (bookmarkIcon == null) {
        bookmarkIcon = ImageUtilities.loadImage(
                "org/netbeans/modules/editor/bookmarks/resources/bookmark_16.png", false);
    }
    return bookmarkIcon;

}
 
源代码16 项目: netbeans   文件: DnDSupport.java
private Window createDragWindow( Image dragImage, Rectangle bounds ) {
    Window w = new Window( SwingUtilities.windowForComponent(sourceRow) );
    w.add(new JLabel(ImageUtilities.image2Icon(dragImage)));
    w.setBounds(bounds);
    w.setVisible(true);
    NativeWindowSystem nws = NativeWindowSystem.getDefault();
    if( nws.isUndecoratedWindowAlphaSupported() ) {
        nws.setWindowAlpha(w, 0.7f);
    }
    return w;
}
 
源代码17 项目: netbeans   文件: ResultWindow.java
/** Creates a new instance of ResultWindow */
@NbBundle.Messages({"TITLE_TEST_RESULTS=Test Results",
    "ACSN_TestResults=Test Results",
    "ACSD_TestResults=Displays information about passed and failed tests and output generated by them"})
public ResultWindow() {
    super();
    setFocusable(true);
    setLayout(new BorderLayout());

    setName(ID);
    setDisplayName(Bundle.TITLE_TEST_RESULTS());
    setIcon(ImageUtilities.loadImage( "org/netbeans/modules/gsf/testrunner/ui/resources/testResults.png", true));//NOI18N
     
    AccessibleContext accContext = getAccessibleContext();
    accContext.setAccessibleName(Bundle.ACSN_TestResults());
    accContext.setAccessibleDescription(Bundle.ACSD_TestResults());

    pop = new JPopupMenu();
    pop.add(new Close());
    pop.add(new CloseAll());
    pop.add(new CloseAllButCurrent());
    popL = new PopupListener();
    closeL = new CloseListener();

    tabPane = TabbedPaneFactory.createCloseButtonTabbedPane();
    tabPane.setMinimumSize(new Dimension(0, 0));
    tabPane.addMouseListener(popL);
    tabPane.addPropertyChangeListener(closeL);
    add(tabPane);
}
 
源代码18 项目: netbeans   文件: CompletionItem.java
@Override
public ImageIcon getIcon() {
    if (newConstructorIcon == null) {
        newConstructorIcon = ImageUtilities.loadImageIcon(NEW_CSTR, false);
    }
    return newConstructorIcon;
}
 
源代码19 项目: netbeans   文件: InstallStep.java
private void notifyNetworkProblem (final OperationException ex) {
    // Some network problem found
    ActionListener onMouseClickAction = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            ProblemPanel problem = new ProblemPanel(ex, false);
            problem.showNetworkProblemDialog ();
        }
    };
    String title = getBundle ("InstallSupport_InBackground_NetworkError");
    String description = getBundle ("InstallSupport_InBackground_NetworkError_Details");
    NotificationDisplayer.getDefault().notify(title, 
            ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/error.png", false), 
            description, onMouseClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.ERROR);
}
 
源代码20 项目: visualvm   文件: TruffleLanguage.java
protected synchronized Image badgeImage() {
    if (badgeImage == null) {
        String path = getClass().getPackage().getName().replace('.', '/') + "/" + getID() + "_badge.png"; // NOI18N
        badgeImage = ImageUtilities.loadImage(path, true);
    }
    return badgeImage;
}
 
源代码21 项目: netbeans   文件: DashboardUtils.java
public static Icon getTaskIcon(IssueImpl issue) {
    Image priorityIcon = issue.getPriorityIcon();
    Image scheduleIcon = getScheduleIcon(issue);
    if (scheduleIcon != null) {
        return ImageUtilities.image2Icon(ImageUtilities.mergeImages(priorityIcon, scheduleIcon, 0, 0));
    }
    return ImageUtilities.image2Icon(priorityIcon);
}
 
源代码22 项目: netbeans   文件: CurrentEditorScanningScope.java
public static CurrentEditorScanningScope create() {
    return new CurrentEditorScanningScope(
            NbBundle.getBundle( CurrentEditorScanningScope.class ).getString( "LBL_CurrentEditorScope" ), //NOI18N)
            NbBundle.getBundle( CurrentEditorScanningScope.class ).getString( "HINT_CurrentEditorScope" ), //NOI18N
            ImageUtilities.loadImage( "org/netbeans/modules/tasklist/ui/resources/cur_editor_scope.png" ) //NOI18N
            );
}
 
源代码23 项目: netbeans   文件: JAXBBindingSupportFileNode.java
public Image getOpenedIcon(int type) {
    if (this.nodeDelegate != null){
        return this.nodeDelegate.getOpenedIcon(type);
    }
    
    return ImageUtilities.loadImage(
            "org/netbeans/modules/xml/jaxb/resources/XML_file.png" );//NOI18N  
}
 
源代码24 项目: netbeans   文件: UiUtils.java
/**
 * Returns default folder icon as {@link Image}. Never returns {@code null}.
 * @param opened whether closed or opened icon should be returned
 * @return default folder icon
 */
public static Image getTreeFolderIcon(boolean opened) {
    Image base = (Image) UIManager.get(opened ? OPENED_ICON_KEY_UIMANAGER_NB : ICON_KEY_UIMANAGER_NB); // #70263
    if (base == null) {
        Icon baseIcon = UIManager.getIcon(opened ? OPENED_ICON_KEY_UIMANAGER : ICON_KEY_UIMANAGER); // #70263
        if (baseIcon != null) {
            base = ImageUtilities.icon2Image(baseIcon);
        } else { // fallback to our owns
            base = ImageUtilities.loadImage(opened ? OPENED_ICON_PATH : ICON_PATH, false);
        }
    }
    return base;
}
 
源代码25 项目: 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
}
 
源代码26 项目: netbeans   文件: ItemRenderer.java
@Override
public void stateChanged(@NonNull final ChangeEvent event) {
    final JViewport jv = (JViewport)event.getSource();
    jlName.setText( "Sample" ); // NOI18N
    jlName.setIcon(ImageUtilities.loadImageIcon(SAMPLE_ITEM_ICON, false));
    jList.setFixedCellHeight(jlName.getPreferredSize().height);
    jList.setFixedCellWidth(jv.getExtentSize().width);
}
 
源代码27 项目: netbeans   文件: DBColumnDrop.java
/**
 * Returns <code>JTextField</code> palette item.
 *
 * @param dtde corresponding drop target drag event.
 * @return <code>JTextField</code> palette item.
 */
@Override
public PaletteItem getPaletteItem(DropTargetDragEvent dtde) {
    PaletteItem pItem;
    if (!assistantInitialized) {
        initAssistant();
    }
    if (!J2EEUtils.hasPrimaryKey(column.getDatabaseConnection(), column.getTableName())) {
        FormEditor.getAssistantModel(model).setContext("tableWithoutPK"); // NOI18N
        return null;
    }
    if (FormJavaSource.isInDefaultPackage(model)) {
        // 97982: default package
        FormEditor.getAssistantModel(model).setContext("columnDefaultPackage"); // NOI18N
        return null;
    }
    setBindingOnly(dtde.getDropAction() == DnDConstants.ACTION_MOVE);
    if (isBindingOnly()) {
        FormEditor.getAssistantModel(model).setContext("columnDropBinding", "columnDropComponent"); // NOI18N
        pItem = new PaletteItem(new ClassSource("javax.persistence.EntityManager", // NOI18N
                    new ClassSourceResolver.LibraryEntry(LibraryManager.getDefault().getLibrary("eclipselink"))), // NOI18N
                    null);
        pItem.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/form/j2ee/resources/binding.gif", false).getImage()); // NOI18N
    } else {
        pItem = new PaletteItem(new ClassSource("javax.swing.JTextField"), null); // NOI18N
    }
    return pItem;
}
 
源代码28 项目: netbeans   文件: AbstractNode.java
Image getDefaultIcon() {
    Image i = ImageUtilities.loadImage(DEFAULT_ICON, true);

    if (i == null) {
        throw new MissingResourceException("No default icon", "", DEFAULT_ICON); // NOI18N
    }

    return i;
}
 
源代码29 项目: NBANDROID-V2   文件: MobileDeviceNode.java
private Image annotateUsbWifi(Image icon) {
    if (device.hasEthernet()) {
        icon = ImageUtilities.mergeImages(icon, IconProvider.IMG_WIFI_BADGE, 12, 0);
    }
    if (device.hasUSB()) {
        icon = ImageUtilities.mergeImages(icon, IconProvider.IMG_USB_BADGE, 12, 8);
    }
    return icon;
}
 
源代码30 项目: netbeans   文件: ZoomManager.java
/**
 * Creates a new instance of ZoomDefaultAction.
 *
 * @param  manager  the zoom manager.
 */
public ZoomDefaultAction(ZoomManager manager) {
    this.manager = manager;
    String path = NbBundle.getMessage(ZoomDefaultAction.class,
            "IMG_ZoomDefaultAction");
    Image img = ImageUtilities.loadImage(path);
    if (img != null) {
        putValue(Action.SMALL_ICON, new ImageIcon(img));
    }
    String desc = NbBundle.getMessage(ZoomDefaultAction.class,
            "LBL_ZoomDefaultAction");
    putValue(Action.NAME, desc); // for accessibility
    putValue(Action.SHORT_DESCRIPTION, desc);
}