當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。