/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrameProvider;
public class CheckForUpdateAction extends AnAction implements DumbAware {
@Override
public void update(AnActionEvent e) {
- e.getPresentation().setVisible(!SystemInfo.isMacSystemMenu || !ActionPlaces.MAIN_MENU.equals(e.getPlace()));
+ final String place = e.getPlace();
+ if (ActionPlaces.WELCOME_SCREEN.equals(place) && FlatWelcomeFrameProvider.isAvailable()) {
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ e.getPresentation().setVisible(!SystemInfo.isMacSystemMenu || !ActionPlaces.MAIN_MENU.equals(place));
+ }
}
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
ActionGroup configureGroup = (ActionGroup)ActionManager.getInstance().getAction(groupId);
final PopupFactoryImpl.ActionGroupPopup popup = (PopupFactoryImpl.ActionGroupPopup)JBPopupFactory.getInstance()
- .createActionGroupPopup(null, new IconsFreeActionGroup(configureGroup), e.getDataContext(), false, false, false, null,
- 10, null);
+ .createActionGroupPopup(null, new IconsFreeActionGroup(configureGroup), e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, ActionPlaces.WELCOME_SCREEN);
popup.showUnderneathOfLabel(ref.get());
}
};
<action id="WelcomeScreen.Configure.DesktopEntry" class="com.intellij.ide.actions.CreateDesktopEntryAction"
icon="AllIcons.Welcome.CreateDesktopEntry"/>
+ <action id="WelcomeScreen.Update" class="com.intellij.openapi.updateSettings.impl.CheckForUpdateAction" text="Check for Update"/>
</group>
<group id="FileChooser">