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


Java IJSwingUtilities类代码示例

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


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

示例1: removeTabAt

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
public final synchronized void removeTabAt(final int index) {
  assertIsDispatchThread();

  final boolean hadFocus = IJSwingUtilities.hasFocus2(myTabbedPaneHolder);
  final TabWrapper wrapper = getWrapperAt(index);
  try {
    myTabbedPane.removeTabAt(index);
    if (myTabbedPane.getTabCount() == 0) {
      // to clear BasicTabbedPaneUI.visibleComponent field
      myTabbedPane.revalidate();
    }
    if (hadFocus) {
      myTabbedPaneHolder.requestFocus();
    }
  }
  finally {
    wrapper.dispose();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TabbedPaneWrapper.java

示例2: queueShow

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
private void queueShow(final JComponent c, final MouseEvent me, final boolean toCenter, int shift, int posChangeX, int posChangeY) {
  String aText = String.valueOf(c.getToolTipText(me));
  final IdeTooltip tooltip = new IdeTooltip(c, me.getPoint(), null, /*new Object()*/c, aText) {
    @Override
    protected boolean beforeShow() {
      myCurrentEvent = me;

      if (!c.isShowing()) return false;

      String text = c.getToolTipText(myCurrentEvent);
      if (text == null || text.trim().isEmpty()) return false;

      JLayeredPane layeredPane = IJSwingUtilities.findParentOfType(c, JLayeredPane.class);

      final JEditorPane pane = initPane(text, new HintHint(me).setAwtTooltip(true), layeredPane);
      final Wrapper wrapper = new Wrapper(pane);
      setTipComponent(wrapper);
      return true;
    }
  }.setToCenter(toCenter).setCalloutShift(shift).setPositionChangeShift(posChangeX, posChangeY).setLayer(Balloon.Layer.top);

  show(tooltip, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:IdeTooltipManager.java

示例3: updateToolWindows

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
public static void updateToolWindows() {
  for (Project project : ProjectManager.getInstance().getOpenProjects()) {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    for (String id : toolWindowManager.getToolWindowIds()) {
      final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
      for (Content content : toolWindow.getContentManager().getContents()) {
        final JComponent component = content.getComponent();
        if (component != null) {
          IJSwingUtilities.updateComponentTreeUI(component);
        }
      }
      final JComponent c = toolWindow.getComponent();
      if (c != null) {
        IJSwingUtilities.updateComponentTreeUI(c);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LafManagerImpl.java

示例4: refreshIntentionHint

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
public void refreshIntentionHint() {
  if(!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)){
    hideIntentionHint();
    return;
  }
  if (myHint == null || !myHint.isVisible()) {
    updateIntentionHintVisibility();
  }
  else {
    final ErrorInfo[] errorInfos = getErrorInfos();
    final Rectangle bounds = getErrorBounds();
    if (!haveFixes(errorInfos) || bounds == null || !bounds.equals(myLastHintBounds)) {
      hideIntentionHint();
      updateIntentionHintVisibility();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:QuickFixManager.java

示例5: showSelectedColumnProperties

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
private boolean showSelectedColumnProperties() {
  if (myCustomPropertiesPanel != null && myPropertiesPanelContainer != null &&
      IJSwingUtilities.hasFocus(myCustomPropertiesPanel.getComponent())) {
    return true;
  }
  if (myEditor == null) return false;
  GridCaptionPanel panel = myEditor.getFocusedCaptionPanel();
  if (panel == null) return false;
  RadContainer container = panel.getSelectedContainer();
  if (container == null) return false;
  final int[] selection = panel.getSelectedCells(null);
  myPropertiesPanelContainer = container;
  final CustomPropertiesPanel propertiesPanel = container.getGridLayoutManager().getRowColumnPropertiesPanel(container, panel.isRow(), selection);
  if (propertiesPanel == null) return false;
  showCustomPropertiesPanel(propertiesPanel);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PropertyInspector.java

示例6: queueShow

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
private void queueShow(final JComponent c, final MouseEvent me, final boolean toCenter, int shift, int posChangeX, int posChangeY) {
  final IdeTooltip tooltip = new IdeTooltip(c, me.getPoint(), null, new Object()) {
    @Override
    protected boolean beforeShow() {
      myCurrentEvent = me;

      if (!c.isShowing()) return false;

      String text = c.getToolTipText(myCurrentEvent);
      if (text == null || text.trim().isEmpty()) return false;

      JLayeredPane layeredPane = IJSwingUtilities.findParentOfType(c, JLayeredPane.class);

      final JEditorPane pane = initPane(text, new HintHint(me).setAwtTooltip(true), layeredPane);
      final Wrapper wrapper = new Wrapper(pane);
      setTipComponent(wrapper);
      return true;
    }
  }.setToCenter(toCenter).setCalloutShift(shift).setPositionChangeShift(posChangeX, posChangeY).setLayer(Balloon.Layer.top);

  show(tooltip, false);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:IdeTooltipManager.java

示例7: removeTabAt

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
public final synchronized void removeTabAt(final int index) {
  assertIsDispatchThread();

  final boolean hadFocus = IJSwingUtilities.hasFocus2(myTabbedPaneHolder);
  final TabWrapper wrapper = getWrapperAt(index);
  try {
    myTabbedPane.removeTabAt(index);
    if (myTabbedPane.getTabCount() == 0) {
      // to clear BasicTabbedPaneUI.visibleComponent field
      myTabbedPane.revalidate();
    }
    if (hadFocus) {
      IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(myTabbedPaneHolder);
    }
  }
  finally {
    wrapper.dispose();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:TabbedPaneWrapper.java

示例8: invokeRatherLater

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
protected void invokeRatherLater(final DebuggerCommandImpl command) {
  IJSwingUtilities.invoke(new Runnable() {
    @Override
    public void run() {
      InvokeRatherLaterRequest request = new InvokeRatherLaterRequest(command, getDebugProcess());
      myRatherLaterRequests.add(request);

      if (myRatherLaterRequests.size() == 1) pumpSwingThread();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ExecutionWithDebuggerToolsTestCase.java

示例9: positionCaretToDeclaration

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
protected static void positionCaretToDeclaration(@NotNull Project project, @NotNull PsiFile psiFile, @NotNull PsiElement declaration) {
  final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
  if (editor != null && (IJSwingUtilities.hasFocus(editor.getComponent()) || ApplicationManager.getApplication().isUnitTestMode())) {
    final PsiFile openedFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
    if (openedFile == psiFile) {
      editor.getCaretModel().moveToOffset(declaration.getTextOffset());
      editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:BaseConvertToLocalQuickFix.java

示例10: updateContentUI

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
private void updateContentUI() {
  if (myActiveContentComponent == null || myActiveFocusedContent == null) return;
  IJSwingUtilities.updateComponentTreeUI(myActiveContentComponent);
  if (myActiveContentComponent instanceof JScrollPane) {
    ((JScrollPane)myActiveContentComponent).getViewport().setBackground(myActiveFocusedContent.getBackground());
  }
  myActiveContentComponent.setBorder(null);

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ProcessPopup.java

示例11: isFocusOwner

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
@Override
public boolean isFocusOwner() {
  if (myEditor != null) {
    return IJSwingUtilities.hasFocus(myEditor.getContentComponent());
  }
  return super.isFocusOwner();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:EditorTextField.java

示例12: setSelectedIndex

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
public final void setSelectedIndex(final int index, boolean requestFocus) {
  assertIsDispatchThread();

  final boolean hadFocus = IJSwingUtilities.hasFocus2(myTabbedPaneHolder);
  myTabbedPane.setSelectedIndex(index);
  if (hadFocus && requestFocus) {
    myTabbedPaneHolder.requestFocus();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:TabbedPaneWrapper.java

示例13: createLabeledPanel

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
public static JPanel createLabeledPanel(String labelText, JComponent component) {
  final JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 4, 2, true, false));
  final JBLabel label = new JBLabel(labelText, UIUtil.ComponentStyle.SMALL);
  IJSwingUtilities.adjustComponentsOnMac(label, component);
  panel.add(label);
  panel.add(component);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JBTableRowEditor.java

示例14: updateUI

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
private static void updateUI(Window window) {
  if (!window.isDisplayable()) {
    return;
  }
  IJSwingUtilities.updateComponentTreeUI(window);
  Window[] children = window.getOwnedWindows();
  for (Window aChildren : children) {
    updateUI(aChildren);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:LafManagerImpl.java

示例15: navigate

import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
@Override
public void navigate(Project project) {
  NotificationListener listener = myNotification.getListener();
  if (listener != null) {
    EventLogConsole console = ObjectUtils.assertNotNull(getProjectComponent(project).getConsole(myNotification));
    JComponent component = console.getConsoleEditor().getContentComponent();
    listener.hyperlinkUpdate(myNotification, IJSwingUtilities.createHyperlinkEvent(myHref, component));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EventLog.java


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