本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例4: getModalityState
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@NotNull
public ModalityState getModalityState() {
if (myModalityStateComponent == null) {
return ModalityState.NON_MODAL;
}
return ModalityState.stateForComponent(myModalityStateComponent);
}
示例5: getModalityState
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Override
public ModalityState getModalityState() {
return ModalityState.stateForComponent(this);
}
示例6: getModalityState
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Override
public ModalityState getModalityState() {
return ModalityState.stateForComponent(IdeMenuBar.this);
}
示例7: getModalityState
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
@Override
public ModalityState getModalityState() {
return ModalityState.stateForComponent(myComponent);
}
示例8: getModalityState
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public ModalityState getModalityState() {
return ModalityState.stateForComponent(ButtonToolbarImpl.this);
}
示例9: AbstractCalledLater
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
protected AbstractCalledLater(Project project, Component component) {
myProject = project;
myState = ModalityState.stateForComponent(component);
}
示例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);
}
示例11: getModalityState
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
private ModalityState getModalityState() {
return ModalityState.stateForComponent(getRootPane());
}
示例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);
}