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


Java OutlineView类代码示例

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


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

示例1: getHorizontalScrollbarPolicy

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private static int getHorizontalScrollbarPolicy() {
    try {
        String prop = System.getProperty(PROP_HORIZONTAL_SCROLLBAR);
        if (prop == null) {
            return OutlineView.HORIZONTAL_SCROLLBAR_AS_NEEDED;
        }
        switch (prop) {
            case "on":                                              //NOI18N
            case "On":                                              //NOI18N
            case "ON":                                              //NOI18N
                return OutlineView.HORIZONTAL_SCROLLBAR_ALWAYS;
            case "off":                                             //NOI18N
            case "Off":                                             //NOI18N
            case "OFF":                                             //NOI18N
                return OutlineView.HORIZONTAL_SCROLLBAR_NEVER;
            default:
                return OutlineView.HORIZONTAL_SCROLLBAR_AS_NEEDED;
        }
    } catch (Exception e) {
        Logger.getLogger(ResultsOutlineSupport.class.getName()).log(
                Level.INFO, null, e);
        return OutlineView.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ResultsOutlineSupport.java

示例2: findUp

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
/**
 * Start finding for next or previous occurance, from a node or its previous
 * or next sibling of node {@code node}
 *
 * @param node reference node
 * @param offset 0 to start from node {@code node}, 1 to start from its next
 * sibling, -1 to start from its previous sibling.
 * @param dir Direction: 1 for next, -1 for previous.
 */
Node findUp(Node node, int dir, int offset, OutlineView outlineView,
        boolean canExpand) {
    if (node == null) {
        return null;
    }
    Node parent = node.getParentNode();
    Node[] siblings;
    if (parent == null) {
        siblings = new Node[]{node};
    } else {
        siblings = getChildren(parent, outlineView, canExpand);
    }
    int nodeIndex = findChildIndex(node, siblings);
    if (nodeIndex + offset < 0 || nodeIndex + offset >= siblings.length) {
        return findUp(parent, dir, dir, outlineView, canExpand);
    }
    for (int i = nodeIndex + offset;
            i >= 0 && i < siblings.length; i += dir) {
        Node found = findDown(siblings[i], siblings, i, dir, outlineView,
                canExpand);
        return found;
    }
    return findUp(parent, dir, offset, outlineView, canExpand);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:AbstractSearchResultsPanel.java

示例3: findDown

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
/**
 * Find Depth-first search to find a detail node in the subtree.
 */
private Node findDown(Node node, Node[] siblings, int nodeIndex,
        int dir, OutlineView outlineView, boolean canExpand) {

    Node[] children = getChildren(node, outlineView, canExpand);
    for (int i = dir > 0 ? 0 : children.length - 1;
            i >= 0 && i < children.length; i += dir) {
        Node found = findDown(children[i], children, i, dir, outlineView,
                canExpand);
        if (found != null) {
            return found;
        }
    }
    for (int i = nodeIndex; i >= 0 && i < siblings.length; i += dir) {
        if (isDetailNode(siblings[i])) {
            return siblings[i];
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:AbstractSearchResultsPanel.java

示例4: initAccessibility

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private void initAccessibility() {
    ResourceBundle bundle = NbBundle.getBundle(ResultView.class);

    AccessibleContext accessCtx;
    OutlineView outlineView = resultsOutlineSupport.getOutlineView();

    accessCtx = outlineView.getHorizontalScrollBar().getAccessibleContext();
    accessCtx.setAccessibleName(
            bundle.getString("ACSN_HorizontalScrollbar"));          //NOI18N

    accessCtx = outlineView.getVerticalScrollBar().getAccessibleContext();
    accessCtx.setAccessibleName(
            bundle.getString("ACSN_VerticalScrollbar"));            //NOI18N

    accessCtx = outlineView.getAccessibleContext();
    accessCtx.setAccessibleName(
            bundle.getString("ACSN_ResultTree"));                   //NOI18N
    accessCtx.setAccessibleDescription(
            bundle.getString("ACSD_ResultTree"));                   //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:BasicAbstractResultsPanel.java

示例5: setUp

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
@Before
public void setUp() {
    rootNode = new RootNode();
    a = rootNode.getChildren().getNodeAt(0);
    b = rootNode.getChildren().getNodeAt(1);
    c = rootNode.getChildren().getNodeAt(2);
    a1 = a.getChildren().getNodeAt(0);
    b2 = b.getChildren().getNodeAt(1);
    c3 = c.getChildren().getNodeAt(2);
    resultsPanel = new AbstractSearchResultsPanel(null, null) {

        @Override
        protected OutlineView getOutlineView() {
            return null;
        }

        @Override
        protected boolean isDetailNode(Node n) {
            return n.getLookup().lookup(TextDetail.class) != null;
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:BasicSearchResultsPanelTest.java

示例6: findUp

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
/**
 * Start finding for next or previous occurance, from a node or its previous
 * or next sibling of node {@code node}
 *
 * @param node reference node
 * @param offset 0 to start from node {@code node}, 1 to start from its next
 * sibling, -1 to start from its previous sibling.
 * @param dir Direction: 1 for next, -1 for previous.
 */
private Node findUp(Node node, int dir, int offset, OutlineView outlineView,
        boolean canExpand) {
    if (node == null) {
        return null;
    }
    Node parent = node.getParentNode();
    Node[] siblings;
    if (parent == null) {
        siblings = new Node[]{node};
    } else {
        siblings = getChildren(parent, outlineView, canExpand);
    }
    int nodeIndex = findChildIndex(node, siblings);
    if (nodeIndex + offset < 0 || nodeIndex + offset >= siblings.length) {
        return findUp(parent, dir, dir, outlineView, canExpand);
    }
    for (int i = nodeIndex + offset;
            i >= 0 && i < siblings.length; i += dir) {
        Node found = findDown(siblings[i], siblings, i, dir, outlineView,
                canExpand);
        return found;
    }
    return findUp(parent, dir, offset, outlineView, canExpand);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:FileTreeView.java

示例7: findDown

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
/**
 * Find Depth-first search to find a detail node in the subtree.
 */
private Node findDown(Node node, Node[] siblings, int nodeIndex,
        int dir, OutlineView outlineView, boolean canExpand) {

    Node[] children = getChildren(node, outlineView, canExpand);
    for (int i = dir > 0 ? 0 : children.length - 1;
            i >= 0 && i < children.length; i += dir) {
        Node found = findDown(children[i], children, i, dir, outlineView,
                canExpand);
        if (found != null) {
            return found;
        }
    }
    for (int i = nodeIndex; i >= 0 && i < siblings.length; i += dir) {
        Node converted = convertNode(siblings[i]);
        if (converted != null) {
            return converted;
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:FileTreeView.java

示例8: initComponents

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    rootLayeredPane = new javax.swing.JLayeredPane();
    outlineView = new OutlineView(getTitle());

    rootLayeredPane.setLayout(new java.awt.GridLayout(1, 0));

    outlineView.setToolTipText(org.openide.util.NbBundle.getMessage(TableMemberPanel.class, "TableMemberPanel.outlineView.toolTipText")); // NOI18N
    rootLayeredPane.add(outlineView);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(rootLayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(rootLayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE)
    );
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:29,代码来源:TableMemberPanel.java

示例9: initComponents

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    rootLayeredPane = new javax.swing.JLayeredPane();
    outlineView = new OutlineView(getTitle());

    rootLayeredPane.setLayout(new java.awt.GridLayout(1, 0));

    outlineView.setToolTipText(org.openide.util.NbBundle.getMessage(EntityMappingMemberPanel.class, "EntityMappingMemberPanel.outlineView.toolTipText")); // NOI18N
    rootLayeredPane.add(outlineView);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(rootLayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(rootLayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE)
    );
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:29,代码来源:EntityMappingMemberPanel.java

示例10: initView

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private void initView() {
    setLayout(new BorderLayout());
    outlineView = new OutlineView(nodesColumnName);
    outlineView.setPropertyColumns(COLUMN_NAMES);
    final Outline outline = outlineView.getOutline();
    outline.setRootVisible(false);
    DefaultTableCellRenderer decimalTableCellRenderer = new StringDecimalFormatRenderer();
    outline.setDefaultRenderer(Double.class, decimalTableCellRenderer);
    outline.setDefaultRenderer(Float.class, decimalTableCellRenderer);
    outline.setDefaultRenderer(Node.Property.class, new MetadataOutlineCellRenderer());
    final TableColumnModel columnModel = outline.getColumnModel();
    columnModel.getColumn(0).setCellRenderer(new MetadataOutlineCellRenderer());
    final int[] columnWidths = COLUMN_WIDTHS;
    for (int i = 0; i < columnModel.getColumnCount(); i++) {
        columnModel.getColumn(i).setPreferredWidth(columnWidths[i]);
    }
    add(outlineView, BorderLayout.CENTER);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:19,代码来源:MetadataViewTopComponent.java

示例11: createOutlineView

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private void createOutlineView() {
    outlineView = new OutlineView(UiUtils.getText(
            "BasicSearchResultsPanel.outline.nodes"));              //NOI18N
    outlineView.getOutline().setDefaultRenderer(Node.Property.class,
            new ResultsOutlineCellRenderer());
    setOutlineColumns();
    outlineView.getOutline().setAutoCreateColumnsFromModel(false);
    outlineView.addTreeExpansionListener(
            new ExpandingTreeExpansionListener());
    outlineView.getOutline().setRootVisible(false);
    outlineView.addHierarchyListener(new HierarchyListener() {
        @Override
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED)
                    != 0) {
                if (outlineView.isDisplayable()) {
                    outlineView.expandNode(resultsNode);
                }
            }
        }
    });
    outlineView.getOutline().getColumnModel().addColumnModelListener(
            new ColumnsListener());
    outlineView.getOutline().getInputMap().remove(
            KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); //#209949
    outlineView.getOutline().getInputMap().put(KeyStroke.getKeyStroke(
            KeyEvent.VK_DELETE,
            0), "hide"); //NOI18N
    outlineView.getOutline().getActionMap().put("hide", SystemAction.get( //NOI18N
            HideResultAction.class));
    outlineView.getOutline().setShowGrid(false);
    Font font = outlineView.getOutline().getFont();
    FontMetrics fm = outlineView.getOutline().getFontMetrics(font);
    outlineView.getOutline().setRowHeight(
            Math.max(16, fm.getHeight()) + VERTICAL_ROW_SPACE);
    outlineView.setTreeHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_POLICY);
    setTooltipHidingBehavior();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:ResultsOutlineSupport.java

示例12: findShiftNode

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private Node findShiftNode(int direction, OutlineView outlineView,
        boolean canExpand) {
    Node[] selected = getExplorerManager().getSelectedNodes();
    Node n = null;
    if ((selected == null || selected.length == 0)
            /* TODO && getExplorerManager().getRootContext() == resultsOutlineSupport.getRootNode() */) {
        n = getExplorerManager().getRootContext();
    } else if (selected.length == 1) {
        n = selected[0];
    }
    return n == null ? null : findDetailNode(n, direction, outlineView,
            canExpand);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:AbstractSearchResultsPanel.java

示例13: getChildren

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private static Node[] getChildren(Node n, OutlineView outlineView,
        boolean canExpand) {
    if (outlineView != null) {
        if (!outlineView.isExpanded(n)) {
            if (canExpand) {
                outlineView.expandNode(n);
            } else {
                return n.getChildren().getNodes(true);
            }
        }
        return getChildrenInDisplayedOrder(n, outlineView);
    } else {
        return n.getChildren().getNodes(true);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:AbstractSearchResultsPanel.java

示例14: getChildrenInDisplayedOrder

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
private static Node[] getChildrenInDisplayedOrder(Node parent,
        OutlineView outlineView) {

    Outline outline = outlineView.getOutline();
    Node[] unsortedChildren = parent.getChildren().getNodes(true);
    int rows = outlineView.getOutline().getRowCount();
    int start = findRowIndexInOutline(parent, outline, rows);
    if (start == -1) {
        return unsortedChildren;
    }
    List<Node> children = new LinkedList<Node>();
    for (int j = start + 1; j < rows; j++) {
        int childModelIndex = outline.convertRowIndexToModel(j);
        if (childModelIndex == -1) {
            continue;
        }
        Object childObject = outline.getModel().getValueAt(
                childModelIndex, 0);
        Node childNode = Visualizer.findNode(childObject);
        if (childNode.getParentNode() == parent) {
            children.add(childNode);
        } else if (children.size() == unsortedChildren.length) {
            break;
        }
    }
    return children.toArray(new Node[children.size()]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:AbstractSearchResultsPanel.java

示例15: DefaultSearchResultsPanel

import org.openide.explorer.view.OutlineView; //导入依赖的package包/类
public DefaultSearchResultsPanel(
        SearchResultsDisplayer.NodeDisplayer<T> nodeDisplayer,
        SearchComposition<T> searchComposition,
        Presenter searchProviderPresenter) {

    super(searchComposition, searchProviderPresenter);
    this.resultsNode = new ResultsNode();
    this.nodeDisplayer = nodeDisplayer;
    resultsNode.update();
    outlineView = new OutlineView(UiUtils.getText(
            "BasicSearchResultsPanel.outline.nodes"));              //NOI18N
    outlineView.getOutline().setRootVisible(false);
    initExpandButton();
    getContentPanel().add(outlineView);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:DefaultSearchResultsPanel.java


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