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


Java ModalityState.stateForComponent方法代码示例

本文整理汇总了Java中com.intellij.openapi.application.ModalityState.stateForComponent方法的典型用法代码示例。如果您正苦于以下问题:Java ModalityState.stateForComponent方法的具体用法?Java ModalityState.stateForComponent怎么用?Java ModalityState.stateForComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.application.ModalityState的用法示例。


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

示例1: doGetData

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Nullable
private Object doGetData(@NotNull String dataId) {
  Component component = myRef.get();
  if (PlatformDataKeys.IS_MODAL_CONTEXT.is(dataId)) {
    if (component == null) {
      return null;
    }
    return IdeKeyEventDispatcher.isModalContext(component);
  }
  if (PlatformDataKeys.CONTEXT_COMPONENT.is(dataId)) {
    return component;
  }
  if (PlatformDataKeys.MODALITY_STATE.is(dataId)) {
    return component != null ? ModalityState.stateForComponent(component) : ModalityState.NON_MODAL;
  }
  if (CommonDataKeys.EDITOR.is(dataId)) {
    Editor editor = (Editor)((DataManagerImpl)DataManager.getInstance()).getData(dataId, component);
    return validateEditor(editor);
  }
  return ((DataManagerImpl)DataManager.getInstance()).getData(dataId, component);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DataManagerImpl.java

示例2: focusKey

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public void focusKey() {
  myKeyField.selectAll();
  //todo[peter,kirillk] without these invokeLaters this requestFocus conflicts with com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.MyDialog.MyWindowListener.windowOpened()
  IdeFocusManager.findInstanceByComponent(myKeyField).requestFocus(myKeyField, true);
  final ModalityState modalityState = ModalityState.stateForComponent(myKeyField);
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              IdeFocusManager.findInstanceByComponent(myKeyField).requestFocus(myKeyField, true);
            }
          }, modalityState);
        }
      }, modalityState);
    }
  }, modalityState);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LiveTemplateSettingsEditor.java

示例3: addMessage

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public void addMessage(final CompilerMessage message) {
  prepareMessageView();

  final CompilerMessageCategory messageCategory = message.getCategory();
  if (CompilerMessageCategory.WARNING.equals(messageCategory)) {
    myWarningCount += 1;
  }
  else if (CompilerMessageCategory.ERROR.equals(messageCategory)) {
    myErrorCount += 1;
    informWolf(message);
  }

  if (ApplicationManager.getApplication().isDispatchThread()) {
    openMessageView();
    doAddMessage(message);
  }
  else {
    final Window window = getWindow();
    final ModalityState modalityState = window != null ? ModalityState.stateForComponent(window) : ModalityState.NON_MODAL;
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        if (myProject != null && !myProject.isDisposed()) {
          openMessageView();
          doAddMessage(message);
        }
      }
    }, modalityState);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:CompilerTask.java

示例4: getModalityState

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@NotNull
public ModalityState getModalityState() {
  if (myModalityStateComponent == null) {
    return ModalityState.NON_MODAL;
  }
  return ModalityState.stateForComponent(myModalityStateComponent);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MergingUpdateQueue.java

示例5: getModalityState

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Override
public ModalityState getModalityState() {
  return ModalityState.stateForComponent(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JBTabsImpl.java

示例6: getModalityState

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Override
public ModalityState getModalityState() {
  return ModalityState.stateForComponent(IdeMenuBar.this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:IdeMenuBar.java

示例7: getModalityState

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Override
public ModalityState getModalityState() {
  return ModalityState.stateForComponent(myComponent);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ToolbarUpdater.java

示例8: getModalityState

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public ModalityState getModalityState() {
  return ModalityState.stateForComponent(ButtonToolbarImpl.this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ButtonToolbarImpl.java

示例9: AbstractCalledLater

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
protected AbstractCalledLater(Project project, Component component) {
  myProject = project;
  myState = ModalityState.stateForComponent(component);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:AbstractCalledLater.java

示例10: LookupUi

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
LookupUi(LookupImpl lookup, Advertiser advertiser, JBList list, Project project) {
  myLookup = lookup;
  myAdvertiser = advertiser;
  myList = list;
  myProject = project;

  myIconPanel.setVisible(false);
  myIconPanel.setBackground(Color.LIGHT_GRAY);
  myIconPanel.add(myProcessIcon);

  JComponent adComponent = advertiser.getAdComponent();
  adComponent.setBorder(new EmptyBorder(0, 1, 1, 2 + AllIcons.Ide.LookupRelevance.getIconWidth()));
  myLayeredPane.mainPanel.add(adComponent, BorderLayout.SOUTH);

  myScrollBarIncreaseButton = new JButton();
  myScrollBarIncreaseButton.setFocusable(false);
  myScrollBarIncreaseButton.setRequestFocusEnabled(false);

  myScrollPane = new JBScrollPane(lookup.getList());
  myScrollPane.setViewportBorder(JBUI.Borders.empty());
  myScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  myScrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(13, -1));
  myScrollPane.getVerticalScrollBar().setUI(new ButtonlessScrollBarUI() {
    @Override
    protected JButton createIncreaseButton(int orientation) {
      return myScrollBarIncreaseButton;
    }
  });
  lookup.getComponent().add(myLayeredPane, BorderLayout.CENTER);

  //IDEA-82111
  fixMouseCheaters();

  myLayeredPane.mainPanel.add(myScrollPane, BorderLayout.CENTER);
  myScrollPane.setBorder(null);

  mySortingLabel.setBorder(new LineBorder(new JBColor(Color.LIGHT_GRAY, JBColor.background())));
  mySortingLabel.setOpaque(true);
  new ChangeLookupSorting().installOn(mySortingLabel);
  updateSorting();
  myModalityState = ModalityState.stateForComponent(lookup.getEditor().getComponent());

  addListeners();

  updateScrollbarVisibility();

  Disposer.register(lookup, myProcessIcon);
  Disposer.register(lookup, myHintAlarm);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:50,代码来源:LookupUi.java

示例11: getModalityState

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
private ModalityState getModalityState() {
  return ModalityState.stateForComponent(getRootPane());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AbstractTreeClassChooserDialog.java

示例12: StructureViewWrapperImpl

import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public StructureViewWrapperImpl(Project project, ToolWindowEx toolWindow) {
  myProject = project;
  myToolWindow = toolWindow;

  myUpdateQueue = new MergingUpdateQueue("StructureView", Registry.intValue("structureView.coalesceTime"), false, myToolWindow.getComponent(), this, myToolWindow.getComponent(), true);
  myUpdateQueue.setRestartTimerOnAdd(true);

  final TimerListener timerListener = new TimerListener() {
    @Override
    public ModalityState getModalityState() {
      return ModalityState.stateForComponent(myToolWindow.getComponent());
    }

    @Override
    public void run() {
      checkUpdate();
    }
  };
  ActionManager.getInstance().addTimerListener(500, timerListener);
  Disposer.register(this, new Disposable() {
    @Override
    public void dispose() {
      ActionManager.getInstance().removeTimerListener(timerListener);
    }
  });

  myToolWindow.getComponent().addHierarchyListener(new HierarchyListener() {
    @Override
    public void hierarchyChanged(HierarchyEvent e) {
      if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
        scheduleRebuild();
      }
    }
  });
  myToolWindow.getContentManager().addContentManagerListener(new ContentManagerAdapter() {
    @Override
    public void selectionChanged(ContentManagerEvent event) {
      if (myStructureView instanceof StructureViewComposite) {
        StructureViewComposite.StructureViewDescriptor[] views = ((StructureViewComposite)myStructureView).getStructureViews();
        for (StructureViewComposite.StructureViewDescriptor view : views) {
          if (view.title.equals(event.getContent().getTabName())) {
            updateHeaderActions(view.structureView);
            break;
          }
        }
      }
    }
  });
  Disposer.register(myToolWindow.getContentManager(), this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:51,代码来源:StructureViewWrapperImpl.java


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