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


Java AwtVisitor类代码示例

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


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

示例1: getActions

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public List<AnAction> getActions(boolean originalProvider) {
  final Ref<ActionToolbar> toolbar = new Ref<ActionToolbar>();
  if (myToolbar != null) {
    new AwtVisitor(myToolbar) {
      @Override
      public boolean visit(Component component) {
        if (component instanceof ActionToolbar) {
          toolbar.set((ActionToolbar)component);
          return true;
        }
        return false;
      }
    };
  }

  if (toolbar.get() != null) {
    return toolbar.get().getActions(originalProvider);
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SimpleToolWindowPanel.java

示例2: getTargets

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
@Override
public List<SwitchTarget> getTargets(final boolean onlyVisible, boolean originalProvider) {
  final ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
  TabInfo selected = myTabs.getSelectedInfo();
  new AwtVisitor(selected.getComponent()) {
    @Override
    public boolean visit(Component component) {
      if (component instanceof JBTabs) {
        JBTabs tabs = (JBTabs)component;
        if (tabs != myTabs) {
          result.addAll(tabs.getTargets(onlyVisible, false));
          return true;
        }
      }
      return false;
    }
  };
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:EditorTabbedContainer.java

示例3: getCurrentTarget

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
@Override
public SwitchTarget getCurrentTarget() {
  TabInfo selected = myTabs.getSelectedInfo();
  final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
  new AwtVisitor(selected.getComponent()) {
    @Override
    public boolean visit(Component component) {
      if (component instanceof JBTabs) {
        JBTabs tabs = (JBTabs)component;
        if (tabs != myTabs) {
          targetRef.set(tabs.getCurrentTarget());
          return true;
        }
      }
      return false;
    }
  };

  return targetRef.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:EditorTabbedContainer.java

示例4: resetProgressBars

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
private void resetProgressBars(final boolean enabled, @Nullable final Boolean completed) {
  new AwtVisitor(myPassStatuses) {
    @Override
    public boolean visit(Component component) {
      if (component instanceof JProgressBar) {
        JProgressBar progress = (JProgressBar)component;
        progress.setEnabled(enabled);
        if (completed != null) {
          if (completed) {
            progress.setValue(TrafficLightRenderer.MAX);
            myProgressToText.get(progress).setText(MAX_TEXT);
          }
          else {
            progress.setValue(0);
            myProgressToText.get(progress).setText(MIN_TEXT);
          }
        }
      }
      return false;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:TrafficProgressPanel.java

示例5: getTargets

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public List<SwitchTarget> getTargets(final boolean onlyVisible, boolean originalProvider) {
  final ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
  TabInfo selected = myTabs.getSelectedInfo();
  new AwtVisitor(selected.getComponent()) {
    @Override
    public boolean visit(Component component) {
      if (component instanceof JBTabs) {
        JBTabs tabs = (JBTabs)component;
        if (tabs != myTabs) {
          result.addAll(tabs.getTargets(onlyVisible, false));
          return true;
        }
      }
      return false;
    }
  };
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:EditorTabbedContainer.java

示例6: getCurrentTarget

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public SwitchTarget getCurrentTarget() {
  TabInfo selected = myTabs.getSelectedInfo();
  final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
  new AwtVisitor(selected.getComponent()) {
    @Override
    public boolean visit(Component component) {
      if (component instanceof JBTabs) {
        JBTabs tabs = (JBTabs)component;
        if (tabs != myTabs) {
          targetRef.set(tabs.getCurrentTarget());
          return true;
        }
      }
      return false;
    }
  };

  return targetRef.get();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:EditorTabbedContainer.java

示例7: setPassesEnabled

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
private void setPassesEnabled(final boolean enabled, @Nullable final Boolean completed) {
  new AwtVisitor(myPassStatuses) {
    @Override
    public boolean visit(Component component) {
      if (component instanceof JProgressBar) {
        JProgressBar progress = (JProgressBar)component;
        progress.setEnabled(enabled);
        if (completed != null) {
          if (completed) {
            progress.setValue(MAX);
            myProgressToText.get(progress).setText(MAX_TEXT);
          }
          else {
            progress.setValue(0);
            myProgressToText.get(progress).setText(MIN_TEXT);
          }
        }
      }
      return false;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:TrafficProgressPanel.java

示例8: unregisterKeyboardActions

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public static void unregisterKeyboardActions(final JRootPane rootPane) {
  new AwtVisitor(rootPane) {
    @Override
    public boolean visit(final Component component) {
      if (component instanceof JComponent) {
        final JComponent eachComp = (JComponent)component;
        final ActionMap actionMap = eachComp.getActionMap();
        final KeyStroke[] strokes = eachComp.getRegisteredKeyStrokes();
        for (KeyStroke eachStroke : strokes) {
          boolean remove = true;
          if (actionMap != null) {
            for (int i : new int[]{JComponent.WHEN_FOCUSED, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, JComponent.WHEN_IN_FOCUSED_WINDOW}) {
              final InputMap inputMap = eachComp.getInputMap(i);
              final Object key = inputMap.get(eachStroke);
              if (key != null) {
                final Action action = actionMap.get(key);
                if (action instanceof UIResource) remove = false;
              }
            }
          }

          if (remove) eachComp.unregisterKeyboardAction(eachStroke);
        }
      }
      return false;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:DialogWrapper.java

示例9: initStyle

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public void initStyle(Component c, boolean includeChildren) {
  if (includeChildren) {
    new AwtVisitor(c) {
      @Override
      public boolean visit(Component component) {
        doInit(component);
        return false;
      }
    };
  } else {
    doInit(c);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:HintHint.java

示例10: processEnabled

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
private void processEnabled() {
  new AwtVisitor(this) {
    @Override
    public boolean visit(Component component) {
      if (component != myEnabled) {
        component.setEnabled(myQaEnabled);
      }
      return false;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:QuickAccessConfigurable.java

示例11: unregisterKeyboardActions

import com.intellij.util.ui.AwtVisitor; //导入依赖的package包/类
public static void unregisterKeyboardActions(final JRootPane rootPane) {
  new AwtVisitor(rootPane) {
    @Override
    public boolean visit(final Component component) {
      if (component instanceof JComponent) {
        final JComponent eachComp = (JComponent)component;
        final ActionMap actionMap = eachComp.getActionMap();
        final KeyStroke[] strokes = eachComp.getRegisteredKeyStrokes();
        for (KeyStroke eachStroke : strokes) {
          boolean remove = true;
          if (actionMap != null) {
            for (int i = 0; i < 3; i++) {
              final InputMap inputMap = eachComp.getInputMap(i);
              final Object key = inputMap.get(eachStroke);
              if (key != null) {
                final Action action = actionMap.get(key);
                if (action instanceof UIResource) remove = false;
              }
            }
          }

          if (remove) eachComp.unregisterKeyboardAction(eachStroke);
        }
      }
      return false;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:DialogWrapper.java


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