本文整理汇总了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();
}
}
示例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);
}
示例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);
}
}
}
}
示例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();
}
}
}
示例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;
}
示例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);
}
示例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();
}
}
示例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();
}
});
}
示例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);
}
}
}
示例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);
}
示例11: isFocusOwner
import com.intellij.util.IJSwingUtilities; //导入依赖的package包/类
@Override
public boolean isFocusOwner() {
if (myEditor != null) {
return IJSwingUtilities.hasFocus(myEditor.getContentComponent());
}
return super.isFocusOwner();
}
示例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();
}
}
示例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;
}
示例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);
}
}
示例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));
}
}