📄 activator.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -