當前位置: 首頁>>代碼示例>>Java>>正文


Java FlatWelcomeFrame類代碼示例

本文整理匯總了Java中com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame的典型用法代碼示例。如果您正苦於以下問題:Java FlatWelcomeFrame類的具體用法?Java FlatWelcomeFrame怎麽用?Java FlatWelcomeFrame使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FlatWelcomeFrame類屬於com.intellij.openapi.wm.impl.welcomeScreen包,在下文中一共展示了FlatWelcomeFrame類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FlatWelcomeScreen

import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame; //導入依賴的package包/類
@RequiredDispatchThread
public FlatWelcomeScreen(FlatWelcomeFrame welcomeFrame) {
  super(new JBCardLayout());
  myWelcomeFrame = welcomeFrame;
  myMainWelcomePanel = new FlatWelcomePanel(welcomeFrame) {
    @Override
    @RequiredDispatchThread
    public JComponent createActionPanel() {
      return FlatWelcomeScreen.this.createActionPanel(this);
    }
  };
  add(myMainWelcomePanel, MAIN);

  registerKeyboardAction(e -> {
    for (Component component : getComponents()) {
      if (component.isVisible() && component != myMainWelcomePanel) {
        replacePanel((JComponent)component);
        break;
      }
    }
  }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:23,代碼來源:FlatWelcomeScreen.java

示例2: createCenterPanel

import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame; //導入依賴的package包/類
@Nullable
@Override
protected JComponent createCenterPanel() {
  final DirectoryProjectGenerator[] generators = Extensions.getExtensions(DirectoryProjectGenerator.EP_NAME);
  setTitle(generators.length == 0 ? "Create Project" : "Select Project Type");
  final DefaultActionGroup root = createRootStep();

  final Pair<JPanel, JBList> panel = FlatWelcomeFrame.createActionGroupPanel(root, getRootPane(), null);
  final Dimension size = JBUI.size(666, 385);
  final JPanel component = panel.first;
  component.setMinimumSize(size);
  component.setPreferredSize(size);
  new AnAction() {
    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
      close(CANCEL_EXIT_CODE);
    }
  }.registerCustomShortcutSet(KeyEvent.VK_ESCAPE, 0, component);
  myList = panel.second;
  UiNotifyConnector.doWhenFirstShown(myList, new Runnable() {
    @Override
    public void run() {
      ScrollingUtil.ensureSelectionExists(myList);
    }
  });
  return component;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:AbstractNewProjectDialog.java

示例3: openFrame

import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame; //導入依賴的package包/類
@RequiredUIAccess
@Nonnull
@Override
public Window openFrame() {
  FlatWelcomeFrame flatWelcomeFrame = new FlatWelcomeFrame();
  flatWelcomeFrame.setVisible(true);
  return flatWelcomeFrame;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:9,代碼來源:DesktopWelcomeFrameManager.java

示例4: MTFlatWelcomeFrame

import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame; //導入依賴的package包/類
MTFlatWelcomeFrame() {
  super();
  final Color color = UIManager.getColor("Panel.background");
  final Color listColor = UIManager.getColor("List.background");

  // Set welcome frame bg
  WelcomeScreen myScreen = ReflectionUtil.getField(FlatWelcomeFrame.class, this, WelcomeScreen.class, "myScreen");
  // Fuck I dunno why sometimes it is compiled (Phpstorm, rubymine) and sometimes not...
  if (myScreen == null) {
    myScreen = ReflectionUtil.getField(FlatWelcomeFrame.class, this, WelcomeScreen.class, "a");
  }
  if (myScreen == null) {
    myScreen = ReflectionUtil.getField(FlatWelcomeFrame.class, this, WelcomeScreen.class, "b");
  }
  if (myScreen == null) {
    myScreen = ReflectionUtil.getField(FlatWelcomeFrame.class, this, WelcomeScreen.class, "c");
  }
  if (myScreen == null) {
    myScreen = ReflectionUtil.getField(FlatWelcomeFrame.class, this, WelcomeScreen.class, "d");
  }
  if (myScreen == null) {
    return;
  }

  final JPanel welcomeScreen = (JPanel) myScreen;
  welcomeScreen.setBackground(color);

  // Set projects bg
  final JBList list = UIUtil.findComponentOfType(welcomeScreen, JBList.class);
  if (list != null) {
    list.setBackground(new JBColor(listColor, listColor));

    final ListCellRenderer renderer = list.getCellRenderer();
    final MTProjectsRenderer mtProjectsRenderer = new MTProjectsRenderer();
    // All this crap just because Jetbrains didnt' bother using UIManager for their colors -_-
    final ListCellRenderer proxy = (ListCellRenderer) Enhancer.create(ListCellRenderer.class, (MethodInterceptor) (o, method, objects,
                                                                                                                   methodProxy) -> {
      final Object result = method.invoke(renderer, objects);

      if (result instanceof JPanel && "getListCellRendererComponent".equals(method.getName())) {
        mtProjectsRenderer.getListCellRenderedComponent((JPanel) result, method, objects);
      }

      return result;
    });

    list.setCellRenderer(proxy);
  }
}
 
開發者ID:ChrisRM,項目名稱:material-theme-jetbrains,代碼行數:50,代碼來源:MTFlatWelcomeFrame.java


注:本文中的com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。