本文整理汇总了Java中com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy类的典型用法代码示例。如果您正苦于以下问题:Java IdeFocusTraversalPolicy类的具体用法?Java IdeFocusTraversalPolicy怎么用?Java IdeFocusTraversalPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdeFocusTraversalPolicy类属于com.intellij.openapi.wm.ex包,在下文中一共展示了IdeFocusTraversalPolicy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startEditing
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
/**
* Starts editing property with the specified <code>index</code>.
* The method does nothing is property isn't editable.
*/
private void startEditing(final int index){
final Property property=myProperties.get(index);
final PropertyEditor editor=property.getEditor();
if(editor==null){
return;
}
editCellAt(index,convertColumnIndexToView(1));
LOG.assertTrue(editorComp!=null);
// Now we have to request focus into the editor component
JComponent prefComponent = editor.getPreferredFocusedComponent((JComponent)editorComp);
if(prefComponent == null){ // use default policy to find preferred focused component
prefComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent((JComponent)editorComp);
}
if (prefComponent != null) {
prefComponent.requestFocusInWindow();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PropertyInspectorTable.java
示例2: startEditing
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
/**
* Starts editing property with the specified <code>index</code>.
* The method does nothing is property isn't editable.
*/
private void startEditing(final int index)
{
final Property property = myProperties.get(index);
final PropertyEditor editor = property.getEditor();
if(editor == null)
{
return;
}
editCellAt(index, convertColumnIndexToView(1));
LOG.assertTrue(editorComp != null);
// Now we have to request focus into the editor component
JComponent prefComponent = editor.getPreferredFocusedComponent((JComponent) editorComp);
if(prefComponent == null)
{ // use default policy to find preferred focused component
prefComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent((JComponent) editorComp);
}
if(prefComponent != null)
{
prefComponent.requestFocusInWindow();
}
}
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:26,代码来源:PropertyInspectorTable.java
示例3: DebuggerTreePanel
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public DebuggerTreePanel(Project project, DebuggerStateManager stateManager) {
super(project, stateManager);
myTree = createTreeView();
final PopupHandler popupHandler = new PopupHandler() {
@Override
public void invokePopup(Component comp, int x, int y) {
ActionPopupMenu popupMenu = createPopupMenu();
if (popupMenu != null) {
myTree.myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y);
}
}
};
myTree.addMouseListener(popupHandler);
setFocusTraversalPolicy(new IdeFocusTraversalPolicy() {
@Override
public Component getDefaultComponentImpl(Container focusCycleRoot) {
return myTree;
}
});
registerDisposable(new Disposable() {
@Override
public void dispose() {
myTree.removeMouseListener(popupHandler);
}
});
final Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts("ToggleBookmark");
final CustomShortcutSet shortcutSet = shortcuts.length > 0? new CustomShortcutSet(shortcuts) : new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0));
overrideShortcut(myTree, XDebuggerActions.MARK_OBJECT, shortcutSet);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:DebuggerTreePanel.java
示例4: showAsDialog
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
private boolean showAsDialog(CreatePatchConfigurationPanel p) {
final DialogBuilder b = new DialogBuilder(myProject);
JComponent createPatchPanel = p.getPanel();
b.setPreferredFocusComponent(IdeFocusTraversalPolicy.getPreferredFocusedComponent(createPatchPanel));
b.setTitle(message("create.patch.dialog.title"));
b.setCenterPanel(createPatchPanel);
p.installOkEnabledListener(new Consumer<Boolean>() {
public void consume(final Boolean aBoolean) {
b.setOkActionEnabled(aBoolean);
}
});
return b.show() == DialogWrapper.OK_EXIT_CODE;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:HistoryDialog.java
示例5: getDefaultComponentImpl
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
@Override
public final Component getDefaultComponentImpl(final Container focusCycleRoot) {
if (myCurrentWindow != null) {
final EditorWithProviderComposite selectedEditor = myCurrentWindow.getSelectedEditor();
if (selectedEditor != null) {
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(selectedEditor.getComponent(), this);
}
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(EditorsSplitters.this, this);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:EditorsSplitters.java
示例6: getPreferredFocusedComponent
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
@Override
public JComponent getPreferredFocusedComponent() {
if (myConfigurable instanceof BaseConfigurable) {
JComponent preferred = ((BaseConfigurable)myConfigurable).getPreferredFocusedComponent();
if (preferred != null) return preferred;
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(myCenterPanel);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SingleConfigurableEditor.java
示例7: requestDefaultFocus
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public boolean requestDefaultFocus() {
if (!myCustomFocus) return super.requestDefaultFocus();
if (myComponent == null) return false; // Just in case someone requests the focus when we're already removed from the Swing tree.
final JComponent preferredFocusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myComponent);
if (preferredFocusedComponent != null) {
if (!preferredFocusedComponent.requestFocusInWindow()) {
preferredFocusedComponent.requestFocus();
}
return true;
} else {
return myComponent.requestDefaultFocus();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TabbedPaneWrapper.java
示例8: getDefaultComponentImpl
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public final Component getDefaultComponentImpl(final Container focusCycleRoot) {
final JComponent component=getSelectedComponent();
if(component!=null){
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(component, this);
}else{
return null;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TabbedPaneWrapper.java
示例9: computeWillFocusComponent
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
private static JComponent computeWillFocusComponent(Content toSelect) {
JComponent toFocus = toSelect.getPreferredFocusableComponent();
if (toFocus != null) {
toFocus = IdeFocusTraversalPolicy.getPreferredFocusedComponent(toFocus);
}
if (toFocus == null) toFocus = toSelect.getPreferredFocusableComponent();
return toFocus;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ContentManagerImpl.java
示例10: startEditing
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
private void startEditing(int index, boolean startedWithKeyboard) {
final PropertyEditor editor = myProperties.get(index).getEditor();
if (editor == null) {
return;
}
editCellAt(index, convertColumnIndexToView(1));
LOG.assertTrue(editorComp != null);
JComponent preferredComponent = editor.getPreferredFocusedComponent();
if (preferredComponent == null) {
preferredComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent((JComponent)editorComp);
}
if (preferredComponent != null) {
preferredComponent.requestFocusInWindow();
}
if (startedWithKeyboard) {
// waiting for focus is necessary in case, if 'activate' opens dialog. If we don't wait for focus, after the dialog is shown we'll
// end up with the table focused instead of the dialog
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(new Runnable() {
@Override
public void run() {
editor.activate();
}
});
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:PropertyTable.java
示例11: switchActivePanel
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public void switchActivePanel() {
final CommanderPanel activePanel = getActivePanel();
final CommanderPanel inactivePanel = getInactivePanel();
inactivePanel.setActive(true);
activePanel.setActive(false);
IdeFocusTraversalPolicy.getPreferredFocusedComponent(inactivePanel).requestFocus();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:Commander.java
示例12: showAntView
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
private void showAntView(boolean treeView) {
final AntOutputView newView = getOutputView(!treeView);
myCurrentView = newView;
myCardLayout.show(myContentPanel, newView.getId());
JComponent component = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myMessagePanel);
component.requestFocus();
repaint();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AntBuildMessageView.java
示例13: DebuggerTreePanel
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public DebuggerTreePanel(Project project, DebuggerStateManager stateManager) {
super(project, stateManager);
myTree = createTreeView();
final PopupHandler popupHandler = new PopupHandler() {
public void invokePopup(Component comp, int x, int y) {
ActionPopupMenu popupMenu = createPopupMenu();
if (popupMenu != null) {
myTree.myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y);
}
}
};
myTree.addMouseListener(popupHandler);
setFocusTraversalPolicy(new IdeFocusTraversalPolicy() {
public Component getDefaultComponentImpl(Container focusCycleRoot) {
return myTree;
}
});
registerDisposable(new Disposable() {
public void dispose() {
myTree.removeMouseListener(popupHandler);
}
});
final Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts("ToggleBookmark");
final CustomShortcutSet shortcutSet = shortcuts.length > 0? new CustomShortcutSet(shortcuts) : new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0));
overrideShortcut(myTree, XDebuggerActions.MARK_OBJECT, shortcutSet);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:DebuggerTreePanel.java
示例14: getDefaultComponentImpl
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public final Component getDefaultComponentImpl(final Container focusCycleRoot) {
if (myCurrentWindow != null) {
final EditorWithProviderComposite selectedEditor = myCurrentWindow.getSelectedEditor();
if (selectedEditor != null) {
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(selectedEditor.getComponent(), this);
}
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(EditorsSplitters.this, this);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:EditorsSplitters.java
示例15: getPreferredFocusedComponent
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
public JComponent getPreferredFocusedComponent() {
if (myConfigurable instanceof BaseConfigurable) {
JComponent preferred = ((BaseConfigurable)myConfigurable).getPreferredFocusedComponent();
if (preferred != null) return preferred;
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(myCenterPanel);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:SingleConfigurableEditor.java
示例16: showAntView
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
private void showAntView(boolean treeView) {
AntOutputView oldView = getOutputView(treeView);
AntOutputView newView = getOutputView(!treeView);
myCurrentView = newView;
myMessagePanel.remove(oldView.getComponent());
myMessagePanel.add(newView.getComponent(), BorderLayout.CENTER);
myMessagePanel.validate();
JComponent component = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myMessagePanel);
component.requestFocus();
repaint();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:AntBuildMessageView.java
示例17: startEditing
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
private void startEditing(int index, boolean startedWithKeyboard) {
final PropertyEditor editor = myProperties.get(index).getEditor();
if (editor == null) {
return;
}
editCellAt(index, convertColumnIndexToView(1));
LOG.assertTrue(editorComp != null);
JComponent preferredComponent = editor.getPreferredFocusedComponent();
if (preferredComponent == null) {
preferredComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent((JComponent) editorComp);
}
if (preferredComponent != null) {
preferredComponent.requestFocusInWindow();
}
if (startedWithKeyboard) {
// waiting for focus is necessary in case, if 'activate' opens dialog. If we don't wait for focus, after the dialog is shown we'll
// end up with the table focused instead of the dialog
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(new Runnable() {
@Override
public void run() {
editor.activate();
}
});
}
}
开发者ID:chrimm,项目名称:cordovastudio,代码行数:29,代码来源:PropertyTable.java
示例18: getDefaultComponentImpl
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
@Override
public final Component getDefaultComponentImpl(final Container focusCycleRoot) {
if (myCurrentWindow != null) {
final EditorWithProviderComposite selectedEditor = myCurrentWindow.getSelectedEditor();
if (selectedEditor != null) {
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(selectedEditor.getComponent(), this);
}
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(DesktopEditorsSplitters.this, this);
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:DesktopEditorsSplitters.java
示例19: getPreferredFocusedComponent
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public JComponent getPreferredFocusedComponent() {
if (myConfigurable instanceof Configurable.HoldPreferredFocusedComponent) {
JComponent preferred = ConfigurableUIMigrationUtil.getPreferredFocusedComponent((Configurable.HoldPreferredFocusedComponent)myConfigurable);
if (preferred != null) return preferred;
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(myCenterPanel);
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:SingleConfigurableEditor.java
示例20: getPreferredFocusedComponent
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public JComponent getPreferredFocusedComponent() {
if (myConfigurable instanceof Configurable.HoldPreferredFocusedComponent) {
JComponent preferred = ConfigurableUIMigrationUtil.getPreferredFocusedComponent((Configurable.HoldPreferredFocusedComponent)myConfigurable);
if (preferred != null) return preferred;
}
return IdeFocusTraversalPolicy.getPreferredFocusedComponent(myRootPanel);
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:WholeWestSingleConfigurableEditor.java
注:本文中的com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论