本文整理匯總了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);
}
示例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;
}
示例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;
}
示例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);
}
}