activator.java
来自「学生成绩管理系统 eclipse rcp开发 swt技术」· Java 代码 · 共 61 行
JAVA
61 行
package com.zdh.sms;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
public static final String PLUGIN_ID = "SMS";
private static Activator plugin;
public Activator() {
plugin = this;
}
public static Activator getDefault() {
return plugin;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
// 打开一个透视图
public static void showPerspective(String perspectiveID) {
try {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
PlatformUI.getWorkbench().showPerspective(perspectiveID, window);
} catch (WorkbenchException e) {
e.printStackTrace();
}
}
private IStatusLineManager statusLine;
public IStatusLineManager getStatusLine() {
return statusLine;
}
public void setStatusLine(IStatusLineManager statusLine) {
this.statusLine = statusLine;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?