本文整理汇总了Java中org.openide.explorer.ExplorerUtils.createLookup方法的典型用法代码示例。如果您正苦于以下问题:Java ExplorerUtils.createLookup方法的具体用法?Java ExplorerUtils.createLookup怎么用?Java ExplorerUtils.createLookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.explorer.ExplorerUtils
的用法示例。
在下文中一共展示了ExplorerUtils.createLookup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractSearchResultsPanel
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
/**
* Creates new form AbstractSearchResultsPanel
*/
public AbstractSearchResultsPanel(SearchComposition<?> searchComposition,
SearchProvider.Presenter searchProviderPresenter) {
this.searchComposition = searchComposition;
this.searchProviderPresenter = searchProviderPresenter;
initComponents();
explorerManager = new ExplorerManager();
ActionMap map = this.getActionMap();
// map delete key to delete action
map.put("delete", //NOI18N
ExplorerUtils.actionDelete(explorerManager, false));
map.put(DefaultEditorKit.copyAction,
ExplorerUtils.actionCopy(explorerManager));
map.put(DefaultEditorKit.cutAction,
ExplorerUtils.actionCut(explorerManager));
lookup = ExplorerUtils.createLookup(explorerManager,
ResultView.getInstance().getActionMap());
initActions();
initToolbar();
initSelectionListeners();
}
示例2: getComponent
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public JComponent getComponent() {
if (panel == null) {
final BeanTreeView view = new BeanTreeView();
view.setRootVisible(false);
view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
// Make sure action context works correctly:
private final Lookup lookup = ExplorerUtils.createLookup(manager, new ActionMap());
{
setLayout(new BorderLayout());
add(view, BorderLayout.CENTER);
}
public ExplorerManager getExplorerManager() {
return manager;
}
public Lookup getLookup() {
return lookup;
}
}
panel = new Panel();
}
return panel;
}
示例3: getComponent
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public JComponent getComponent() {
if (panel == null) {
final BeanTreeView view = new BeanTreeView();
view.setRootVisible(true);
view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
// Make sure action context works correctly:
private final Lookup lookup = ExplorerUtils.createLookup(manager, new ActionMap());
{
setLayout(new BorderLayout());
add(view, BorderLayout.CENTER);
}
public ExplorerManager getExplorerManager() {
return manager;
}
public Lookup getLookup() {
return lookup;
}
}
panel = new Panel();
}
return panel;
}
示例4: getComponent
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public JComponent getComponent() {
if (panel == null) {
final PropertySheetView view = new PropertySheetView();
class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
// Make sure action context works correctly:
private final Lookup lookup = ExplorerUtils.createLookup(manager, new ActionMap());
{
setLayout(new BorderLayout());
add(view, BorderLayout.CENTER);
}
public ExplorerManager getExplorerManager() {
return manager;
}
public Lookup getLookup() {
return lookup;
}
}
panel = new Panel();
}
return panel;
}
示例5: ListViewNavigatorPanel
import org.openide.explorer.ExplorerUtils; //导入方法依赖的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);
}
示例6: TerrainEditorTopComponent
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public TerrainEditorTopComponent() {
initComponents();
setName(NbBundle.getMessage(TerrainEditorTopComponent.class, "CTL_TerrainEditorTopComponent"));
setToolTipText(NbBundle.getMessage(TerrainEditorTopComponent.class, "HINT_TerrainEditorTopComponent"));
//content = new InstanceContent();
/*ActionMap actionMap = getActionMap();
for (Object key : actionMap.allKeys() ) {
System.out.println("key: "+key+ actionMap.get(key));
Action value = actionMap.get(key);
}*/
//actionMap.put(, terrainWizard);
Lookup lookup = ExplorerUtils.createLookup(new ExplorerManager(), getActionMap());
associateLookup(lookup);
setIcon(ImageUtilities.loadImage(ICON_PATH, true));
result = Utilities.actionsGlobalContext().lookupResult(JmeSpatial.class);
}
示例7: createComponents
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
private void createComponents() {
explorerManager = new ExplorerManager();
lookup = ExplorerUtils.createLookup(explorerManager, getActionMap());
setLayout(new java.awt.BorderLayout());
treeView = new BeanTreeView();
add(treeView, BorderLayout.CENTER);
}
示例8: ClassMemberPanelUI
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
/** Creates new form ClassMemberPanelUi */
public ClassMemberPanelUI(final Language language) {
initComponents();
// Tree view of the elements
elementView = createBeanTreeView();
add(elementView, BorderLayout.CENTER);
filters = new ClassMemberFilters( this );
filters.getInstance().hookChangeListener(this);
// See http://www.netbeans.org/issues/show_bug.cgi?id=186407
// Making the calls to getStructure() out of AWT EDT
RP.post(new UpdateFilterState(language));
// filters
filtersPanel = new TapPanel();
filtersLbl = new JLabel(NbBundle.getMessage(ClassMemberPanelUI.class, "LBL_Filter")); //NOI18N
filtersLbl.setBorder(new EmptyBorder(0, 5, 5, 0));
filtersPanel.add(filtersLbl);
filtersPanel.setOrientation(TapPanel.DOWN);
// tooltip
KeyStroke toggleKey = KeyStroke.getKeyStroke(KeyEvent.VK_T,
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
String keyText = Utilities.keyToString(toggleKey);
filtersPanel.setToolTipText(NbBundle.getMessage(ClassMemberPanelUI.class, "TIP_TapPanel", keyText));
filtersPanel.add(filters.getComponent());
add(filtersPanel, BorderLayout.SOUTH);
manager.setRootContext(ElementNode.getWaitNode());
lookup = ExplorerUtils.createLookup(manager, getActionMap());
}
示例9: ExpPanel
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public ExpPanel() {
manager = new ExplorerManager();
ActionMap map = getActionMap();
map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager));
map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager));
map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager));
map.put("delete", ExplorerUtils.actionDelete(manager, true));
lookup = ExplorerUtils.createLookup(manager, map);
InputMap keys = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
keys.put(KeyStroke.getKeyStroke("control c"), DefaultEditorKit.copyAction);
keys.put(KeyStroke.getKeyStroke("control x"), DefaultEditorKit.cutAction);
keys.put(KeyStroke.getKeyStroke("control v"), DefaultEditorKit.pasteAction);
keys.put(KeyStroke.getKeyStroke("DELETE"), "delete");
}
示例10: ToolBarView
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
ToolBarView(final ExplorerManager manager, org.openide.nodes.Node root, javax.swing.Action helpAction) {
super();
this.manager=manager;
this.helpAction=helpAction;
// same as before...
setLayout(new java.awt.GridBagLayout());
ActionMap map = getActionMap();
// ...and initialization of lookup variable
lookup = ExplorerUtils.createLookup (manager, map);
ChoiceView cView = new ChoiceView();
((NodeListModel)(cView.getModel())).setNode(root);
setFloatable(false);
((NodeListModel)(cView.getModel())).setDepth(5);
java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.insets = new java.awt.Insets(0, 2, 4, 0);
add(cView,gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.weightx = 1.0;
JPanel filler = new JPanel();
add(filler,gridBagConstraints);
javax.swing.JButton helpButton = new javax.swing.JButton(helpAction);
helpButton.setText("");
helpButton.setContentAreaFilled(false);
helpButton.setFocusPainted(false);
helpButton.setBorderPainted(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 0;
//gridBagConstraints.weightx = 1.0;
add(helpButton,gridBagConstraints);
}
示例11: EM
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public EM() {
manager = new ExplorerManager();
ActionMap map = getActionMap();
map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager));
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);
initComponent();
}
示例12: SceneNavigatorPanel
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
public SceneNavigatorPanel() {
ActionMap map = getActionMap();
Action copyAction = ExplorerUtils.actionCopy(explorerManager);
map.put(DefaultEditorKit.copyAction, copyAction);
map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(explorerManager));
map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(explorerManager));
map.put("delete", ExplorerUtils.actionDelete(explorerManager, true)); // or false
lookup = ExplorerUtils.createLookup(explorerManager, map);
setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.LINE_AXIS));
add(beanTreeView);
nodeSelectionResult = Utilities.actionsGlobalContext().lookupResult(AbstractSceneExplorerNode.class);
}
示例13: init
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
protected void init(OfficeDataObject dataObject) {
services = new InstanceContent();
Lookup actionsLookup = ExplorerUtils.createLookup(new ExplorerManager(), getActionMap());
Lookup lookup = new ProxyLookup(actionsLookup, dataObject.getLookup(), new AbstractLookup(services));
associateLookup(lookup);
initComponents();
FileObject documentFileObject = dataObject.getPrimaryFile();
String fileDisplayName = FileUtil.getFileDisplayName(documentFileObject);
setToolTipText(fileDisplayName);
setName(documentFileObject.getName());
loadDocument(documentFileObject);
}
示例14: initLookup
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
private void initLookup() {
Lookup explorerLookup; // lookup for EpxlorerManager
Lookup plainContentLookup; // lookup with various fixed instances
Lookup paletteLookup; // lookup for palette
Lookup saveCookieLookup; // to make sure Save action is enabled
Lookup dataObjectLookup; // to make sure DO is in lookup even if no node selected
if (lookup == null) {
lookup = new FormProxyLookup();
explorerLookup = null;
lookupContent = new InstanceContent();
lookupContent.add(new NavigatorLookupPanelsPolicy() {
@Override
public int getPanelsPolicy() {
return NavigatorLookupPanelsPolicy.LOOKUP_HINTS_ONLY;
}
});
lookupContent.add(new NavigatorLookupHint() {
@Override
public String getContentType() {
return "text/x-form"; // NOI18N
}
});
plainContentLookup = new AbstractLookup(lookupContent);
paletteLookup = PaletteUtils.getPaletteLookup(formEditor.getFormDataObject().getPrimaryFile());
saveCookieLookup = new Lookup() {
@Override
public <T> T lookup(final Class<T> clazz) {
if (clazz.isAssignableFrom(SaveCookie.class) && formEditor != null) {
return formEditor.getFormDataObject().getLookup().lookup(clazz);
} else {
return null;
}
}
@Override
public <T> Result<T> lookup(Template<T> template) {
if (template.getType().isAssignableFrom(SaveCookie.class) && formEditor != null) {
return formEditor.getFormDataObject().getLookup().lookup(template);
} else {
return Lookup.EMPTY.lookup(template);
}
}
};
dataObjectLookup = null;
} else {
Lookup[] lookups = lookup.getSubLookups();
explorerLookup = lookups[0];
plainContentLookup = lookups[1];
paletteLookup = lookups[2];
saveCookieLookup = lookups[3];
dataObjectLookup = lookups[4];
}
if (!initialized) {
explorerLookup = Lookup.EMPTY;
} else if (explorerLookup == Lookup.EMPTY) {
// TODO ActionMap from TC? There was some close action in it. But works even without that...
ActionMap map = ComponentInspector.getInstance().setupActionMap(canvasRoot.getActionMap());
explorerLookup = ExplorerUtils.createLookup(explorerManager, map);
}
if (dataObjectLookup == null || (dataObjectLookup == Lookup.EMPTY && !initialized)) {
FormDataObject formDataObject = formEditor.getFormDataObject();
dataObjectLookup = formDataObject.getNodeDelegate().getLookup();
}
lookup.setSubLookups(new Lookup[] {
explorerLookup, plainContentLookup, paletteLookup, saveCookieLookup, dataObjectLookup
});
}
示例15: MatDefNavigatorPanel
import org.openide.explorer.ExplorerUtils; //导入方法依赖的package包/类
/**
* Creates new form MatDefNavigatorPanel
*/
public MatDefNavigatorPanel() {
initComponents();
lookup = ExplorerUtils.createLookup(mgr, getActionMap());
}