本文整理汇总了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;
}
}
示例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);
}
示例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;
}
示例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
}
示例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;
}
};
}
示例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);
}
示例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;
}
示例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)
);
}
示例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)
);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
}
示例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()]);
}
示例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);
}