当前位置: 首页>>代码示例>>Java>>正文


Java ListView类代码示例

本文整理汇总了Java中org.openide.explorer.view.ListView的典型用法代码示例。如果您正苦于以下问题:Java ListView类的具体用法?Java ListView怎么用?Java ListView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ListView类属于org.openide.explorer.view包,在下文中一共展示了ListView类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getComponent

import org.openide.explorer.view.ListView; //导入依赖的package包/类
public JComponent getComponent() {
    if (panel == null) {
        final ListView view = new ListView();
        view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
            // Make sure action context works correctly:
            {
                setLayout(new BorderLayout());
                add(view, BorderLayout.CENTER);
            }
            public ExplorerManager getExplorerManager() {
                return manager;
            }
            @Override
            public boolean requestFocusInWindow() {
                return view.requestFocusInWindow();
            }
            public Lookup getLookup() {
                return lookup;
            }
        }
        panel = new Panel();
    }
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:AntNavigatorPanel.java

示例2: createListView

import org.openide.explorer.view.ListView; //导入依赖的package包/类
private JPanel createListView () {
    JPanel panel = new JPanel();
    // Defined size in #36907 - surrounding controls will add to this size
    // and result is desired 540x400. Note that we can't hardcode size of
    // whole dialog to work correctly with different font size
    panel.setPreferredSize(new Dimension(375, 232));
    panel.setLayout(new BorderLayout());
    listView = new ListView();
    // proper border for the view
    listView.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
    listView.setPopupAllowed(false);
    listView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_ListView"));
    //view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    listView.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ).put( KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "closeSelected") ;//NOI18N
    listView.getActionMap().put( "closeSelected", new AbstractAction() {//NOI18N
        @Override
        public void actionPerformed( ActionEvent e ) {
            closeDocuments(e );
        }

    });
    panel.add(listView, BorderLayout.CENTER);
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:DocumentsDlg.java

示例3: ListViewNavigatorPanel

import org.openide.explorer.view.ListView; //导入依赖的package包/类
public ListViewNavigatorPanel () {
    manager = new ExplorerManager();
    ActionMap map = getActionMap();
    copyAction = ExplorerUtils.actionCopy(manager);
    map.put(DefaultEditorKit.copyAction, copyAction);
    map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager));
    map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager));
    map.put("delete", ExplorerUtils.actionDelete(manager, true)); // or false

    lookup = ExplorerUtils.createLookup(manager, map);

    listView = new ListView();
    fillListView(listView);
            
    add(listView);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ListViewNavigatorPanel.java

示例4: BorderPanel

import org.openide.explorer.view.ListView; //导入依赖的package包/类
private BorderPanel() {
    getExplorerManager().addPropertyChangeListener(this);
    getExplorerManager().addVetoableChangeListener(this);

    setLayout(new BorderLayout());
    setBorder(new EmptyBorder(5, 5, 5, 5));            

    ResourceBundle bundle = getBundle();

    ListView listView = new ListView();
    listView.getAccessibleContext().setAccessibleDescription(
        bundle.getString("ACSD_AvailableBorders")); // NOI18N
    
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, bundle.getString("LAB_AvailableBorders")); // NOI18N
    label.setLabelFor(listView);

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout(0, 2));
    panel.add(label, BorderLayout.NORTH);
    panel.add(BorderLayout.CENTER, listView);

    PropertySheetView sheetView = new PropertySheetView();
    
    JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    split.setTopComponent(panel);
    split.setBottomComponent(sheetView);
    split.setUI(new javax.swing.plaf.basic.BasicSplitPaneUI());
    split.setBorder(BorderFactory.createEmptyBorder());
    split.setDividerLocation(170);
    split.setContinuousLayout(true);
    
    add(BorderLayout.CENTER, split);
    
    getAccessibleContext().setAccessibleDescription(
        bundle.getString("ACSD_BorderCustomEditor")); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:BorderEditor.java

示例5: fillListView

import org.openide.explorer.view.ListView; //导入依赖的package包/类
private void fillListView(ListView listView) {
    try {
        Node testNode = new AbstractNode(Children.LEAF);
        manager.setRootContext(testNode);
        manager.setSelectedNodes(new Node[]{testNode});
    } catch (PropertyVetoException ex) {
        Exceptions.printStackTrace(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ListViewNavigatorPanel.java

示例6: initComponent

import org.openide.explorer.view.ListView; //导入依赖的package包/类
private void initComponent() {
    setLayout(new GridBagLayout());
    
    GridBagConstraints cons = new GridBagConstraints();
    cons.gridx = 0;
    cons.gridy = 0;
    cons.weightx = 1.0D;
    cons.fill = GridBagConstraints.HORIZONTAL;
    cons.insets = new Insets(11, 11, 0, 12);
    
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, NbBundle.getMessage(Install.class, "LAB_PendingTasks"));
    
    add(label, cons);
    
    cons.gridy = 1;
    cons.weighty = 1.0D;
    cons.fill = GridBagConstraints.BOTH;
    cons.insets = new Insets(2, 11, 0, 12);
    
    ListView view = new ListView();
    //#66881
    view.setBorder(UIManager.getBorder("Nb.ScrollPane.border"));
    label.setLabelFor(view);
    
    add(view, cons);
    
    view.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(Install.class, "ACSD_PendingTasks"));
    getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(Install.class, "ACSD_PendingTitle"));
    
    // set size requested by HIE guys
    Dimension origSize = getPreferredSize();
    setPreferredSize(new Dimension(origSize.width * 5 / 4, origSize.height));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:Install.java

示例7: CategorySelector

import org.openide.explorer.view.ListView; //导入依赖的package包/类
CategorySelector() {
    explorerManager = new ExplorerManager();	
    explorerManager.setRootContext(getCategoryRootNode());	
	
    ListView listView = new ListView();
    // Issue 50703 - restore the default scroll pane's border
    JScrollPane scrollPane = new JScrollPane();
    listView.setBorder(scrollPane.getBorder());
    listView.getAccessibleContext().setAccessibleDescription(
        PaletteUtils.getBundleString("ACSD_CTL_PaletteCategories")); // NOI18N
    listView.setPopupAllowed(false);
    listView.setTraversalAllowed(false);
	
    JLabel categoryLabel = new JLabel();
    org.openide.awt.Mnemonics.setLocalizedText(categoryLabel, 
            PaletteUtils.getBundleString("CTL_PaletteCategories")); // NOI18N
    if ((listView.getViewport() != null) && (listView.getViewport().getView() != null)) {
        categoryLabel.setLabelFor(listView.getViewport().getView());
    } else {
        categoryLabel.setLabelFor(listView);
    }

    getAccessibleContext().setAccessibleDescription(
        PaletteUtils.getBundleString("ACSD_PaletteCategoriesSelector")); // NOI18N

    setLayout(new java.awt.BorderLayout(0, 5));
    add(categoryLabel, java.awt.BorderLayout.NORTH);
    add(listView, java.awt.BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:CategorySelector.java

示例8: initComponents

import org.openide.explorer.view.ListView; //导入依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());
    list = new ListView();
    add(list, BorderLayout.CENTER);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:6,代码来源:ExpandableNavigatorPanel.java


注:本文中的org.openide.explorer.view.ListView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。