mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
leftoveras from idea
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.intellij.openapi.wm;
|
||||
|
||||
import com.intellij.openapi.wm.impl.FrameTitleBuilder;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class IdeaFrameTitleBuilder extends FrameTitleBuilder {
|
||||
public String getProjectTitle(final Project project) {
|
||||
final VirtualFile baseDir = project.getBaseDir();
|
||||
if (baseDir != null) {
|
||||
return project.getName() + " - [" + baseDir.getPresentableUrl() + "]";
|
||||
}
|
||||
return project.getName();
|
||||
}
|
||||
|
||||
public String getFileTitle(final Project project, final VirtualFile file) {
|
||||
return ProjectUtil.calcRelativeToProjectPath(file, project);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.intellij.openapi.wm.impl.welcomeScreen;
|
||||
|
||||
import com.intellij.ide.BrowserUtil;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.ui.UIBundle;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class DevelopPluginsAction extends AnAction implements DumbAware {
|
||||
@NonNls private static final String PLUGIN_URL = PathManager.getHomePath() + "/Plugin Development Readme.html";
|
||||
@NonNls private static final String PLUGIN_WEBSITE = "http://www.jetbrains.com/idea/plugins/plugin_developers.html";
|
||||
|
||||
public DevelopPluginsAction() {
|
||||
getTemplatePresentation().setDescription(UIBundle.message("welcome.screen.plugin.development.action.description",
|
||||
ApplicationNamesInfo.getInstance().getFullProductName()));
|
||||
}
|
||||
|
||||
public void actionPerformed(final AnActionEvent e) {
|
||||
try {
|
||||
if (new File(PLUGIN_URL).isFile()) {
|
||||
BrowserUtil.launchBrowser(PLUGIN_URL);
|
||||
}
|
||||
else {
|
||||
BrowserUtil.launchBrowser(PLUGIN_WEBSITE);
|
||||
}
|
||||
}
|
||||
catch(IllegalStateException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.intellij.openapi.wm.impl.welcomeScreen;
|
||||
|
||||
import com.intellij.ide.actions.OpenProjectAction;
|
||||
import com.intellij.ui.UIBundle;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class WelcomeScreenOpenProjectAction extends OpenProjectAction {
|
||||
public WelcomeScreenOpenProjectAction() {
|
||||
getTemplatePresentation().setDescription(UIBundle.message("welcome.screen.open.project.action.description",
|
||||
ApplicationNamesInfo.getInstance().getFullProductName()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user