本文整理汇总了Java中com.intellij.ui.treeStructure.SimpleTree类的典型用法代码示例。如果您正苦于以下问题:Java SimpleTree类的具体用法?Java SimpleTree怎么用?Java SimpleTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleTree类属于com.intellij.ui.treeStructure包,在下文中一共展示了SimpleTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SwitchVersionAction
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
/**
* Creates the action with its text, description and icon.
*
* @param tree LivingDoc repository tree.
* @param toWorkingVersion true for current/working version. False otherwise.
*/
public SwitchVersionAction(final SimpleTree tree, final boolean toWorkingVersion) {
super();
this.repositoryTree = tree;
this.toCurrentVersion = toWorkingVersion;
String text;
Icon icon;
if (toCurrentVersion) {
text = I18nSupport.getValue("toolwindows.action.working.tooltip");
icon = AllIcons.Actions.NewFolder;
} else {
text = I18nSupport.getValue("toolwindows.action.implemented.tooltip");
icon = AllIcons.Actions.Module;
}
Presentation presentation = getTemplatePresentation();
presentation.setText(text);
presentation.setDescription(text);
presentation.setIcon(icon);
}
示例2: setupMetadataPanel
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
private void setupMetadataPanel(Project project, SimpleToolWindowPanel metadataPanel) {
RestClientService restClientService = ServiceManager.getService(project, RestClientService.class);
SimpleNode metadataRootNode = new MetadataExplorerRootNode(project, restClientService, "Metadata");
SimpleTree metadataTree = new SimpleTree();
SimpleTreeBuilder metadataTreeBuilder = new SimpleTreeBuilder(metadataTree, (DefaultTreeModel)metadataTree.getModel(), new ExplorerTreeStructure(metadataRootNode), null);
Disposer.register(project, metadataTreeBuilder);
metadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(metadataTreeBuilder));
metadataTree.setCellRenderer(new ExplorerCellRenderer());
ActionToolbar toolbar = createToolbar(metadataRootNode, metadataTreeBuilder);
toolbar.setTargetComponent(metadataPanel);
metadataPanel.setToolbar(toolbar.getComponent());
metadataPanel.setContent(ScrollPaneFactory.createScrollPane(metadataTree));
metadataTree.setShowsRootHandles(true);
}
示例3: setupToolingMetadataPanel
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
private void setupToolingMetadataPanel(Project project, SimpleToolWindowPanel toolingMetadataPanel) {
ToolingRestClientService toolingRestClientService = ServiceManager.getService(project, ToolingRestClientService.class);
SimpleNode toolingMetadataRootNode = new MetadataExplorerRootNode(project, toolingRestClientService, " Tooling Metadata");
SimpleTree toolingMetadataTree = new SimpleTree();
SimpleTreeBuilder toolingMetadataTreeBuilder = new SimpleTreeBuilder(toolingMetadataTree, (DefaultTreeModel)toolingMetadataTree.getModel(), new ExplorerTreeStructure(toolingMetadataRootNode), null);
Disposer.register(project, toolingMetadataTreeBuilder);
toolingMetadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(toolingMetadataTreeBuilder));
toolingMetadataTree.setCellRenderer(new ExplorerCellRenderer());
ActionToolbar toolbar = createToolbar(toolingMetadataRootNode, toolingMetadataTreeBuilder);
toolbar.setTargetComponent(toolingMetadataPanel);
toolingMetadataPanel.setToolbar(toolbar.getComponent());
toolingMetadataPanel.setContent(ScrollPaneFactory.createScrollPane(toolingMetadataTree));
toolingMetadataTree.setShowsRootHandles(true);
}
示例4: handleDoubleClickOrEnter
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
String actionId = getActionId();
if (actionId != null) {
NavigatorUtil.executeAction(actionId, inputEvent);
} else if (!(this instanceof SeedStackGroupNode)) {
Optional.ofNullable(getNavigatable()).ifPresent(navigatable -> navigatable.navigate(true));
}
}
示例5: initTree
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
private void initTree() {
tree = new SimpleTree() {
private final JLabel myLabel = new JLabel("This is not a SeedStack project.");
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (!isSeedStackProject()) {
myLabel.setFont(getFont());
myLabel.setBackground(getBackground());
myLabel.setForeground(getForeground());
Rectangle bounds = getBounds();
Dimension size = myLabel.getPreferredSize();
myLabel.setBounds(0, 0, size.width, size.height);
int x = (bounds.width - size.width) / 2;
Graphics g2 = g.create(bounds.x + x, bounds.y + 20, bounds.width, bounds.height);
try {
myLabel.paint(g2);
} finally {
g2.dispose();
}
}
}
};
tree.getEmptyText().clear();
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
}
示例6: SeedStackStructure
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
SeedStackStructure(Project project, SimpleTree tree) {
this.project = project;
tree.setRootVisible(true);
tree.setShowsRootHandles(true);
rootNode = new RootNode();
treeBuilder = new SimpleTreeBuilder(tree, (DefaultTreeModel) tree.getModel(), this, null);
Disposer.register(this.project, treeBuilder);
treeBuilder.initRoot();
}
示例7: getSelectedNodes
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
static <T extends SimpleNode> List<T> getSelectedNodes(SimpleTree tree, Class<T> nodeClass) {
final List<T> filtered = new ArrayList<>();
for (SimpleNode node : getSelectedNodes(tree)) {
if ((nodeClass != null) && (!nodeClass.isInstance(node))) {
filtered.clear();
break;
}
//noinspection unchecked
filtered.add((T) node);
}
return filtered;
}
示例8: SeedStackNavigatorPanel
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
SeedStackNavigatorPanel(Project project, SimpleTree tree) {
super(true, true);
this.project = project;
this.tree = tree;
final ActionManager actionManager = ActionManager.getInstance();
ActionToolbar actionToolbar = actionManager.createActionToolbar(
"SeedStack Navigator Toolbar",
(DefaultActionGroup) actionManager.getAction("SeedStack.NavigatorActionsToolbar"),
true
);
actionToolbar.setTargetComponent(tree);
setToolbar(actionToolbar.getComponent());
setContent(ScrollPaneFactory.createScrollPane(tree));
}
示例9: TagImplementedAction
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
/**
* @param tree LivingDoc repository tree.
*/
public TagImplementedAction(final SimpleTree tree) {
super(I18nSupport.getValue("toolwindows.action.tag.tooltip"),
I18nSupport.getValue("toolwindows.action.tag.tooltip"),
AllIcons.Actions.GroupByPackage);
this.repositoryTree = tree;
}
示例10: OpenRemoteDocumentAction
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
/**
* Creates the action with its text, description and icon.
*
* @param tree LivingDoc repository tree.
*/
public OpenRemoteDocumentAction(final SimpleTree tree) {
super(I18nSupport.getValue("toolwindows.action.open.tooltip"),
I18nSupport.getValue("toolwindows.action.open.tooltip"),
AllIcons.Javaee.WebModule);
this.repositoryTree = tree;
}
示例11: createRepositoryTree
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
private void createRepositoryTree() {
tree = new SimpleTree();
tree.setCellRenderer(new TreeCellRendererLivingDoc());
tree.setRootVisible(true);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
treeModel = new DefaultTreeModel(rootNode, true);
tree.setModel(treeModel);
JBScrollPane scrollPane = new JBScrollPane(tree);
mainContent.add(scrollPane, BorderLayout.CENTER);
}
示例12: handleDoubleClickOrEnter
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
mySubstitutionParameters.setShowContent(this);
final LayoutTree layoutTree = (LayoutTree)tree;
final CompositePackagingElementNode parentNode = getParentNode();
if (parentNode != null) {
layoutTree.addSubtreeToUpdate(parentNode);
}
}
示例13: getSelected
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Nullable
private Object getSelected() {
if (isSimpleTree()) {
FilteringTreeStructure.FilteringNode selected = (FilteringTreeStructure.FilteringNode)((SimpleTree)myTree).getSelectedNode();
return selected != null ? selected.getDelegate() : null;
} else {
final Object[] nodes = myTree.getSelectedNodes(Object.class, null);
return nodes.length > 0 ? nodes[0] : null;
}
}
示例14: handleDoubleClickOrEnter
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
final Project project = getExternalProjectsView().getProject();
ProgramRunnerUtil.executeConfiguration(project, mySettings, DefaultRunExecutor.getRunExecutorInstance());
final RunManagerEx runManagerEx = RunManagerEx.getInstanceEx(project);
runManagerEx.setSelectedConfiguration(mySettings);
}
示例15: handleDoubleClickOrEnter
import com.intellij.ui.treeStructure.SimpleTree; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
if (inputEvent instanceof MouseEvent) {
inputEvent.consume();
}
final DomElement domElement = getDomElement();
if (domElement.isValid()) {
final DomElementNavigationProvider provider = DomElementsNavigationManager.getManager(domElement.getManager().getProject())
.getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);
provider.navigate(domElement, true);
}
}