📄 applicationactionbaradvisor.java
字号:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: ApplicationActionBarAdvisor.java
package fileexplorer;
import fileexplorer.action.OpenFileAction;
import org.eclipse.jface.action.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
public class ApplicationActionBarAdvisor extends ActionBarAdvisor
{
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer)
{
super(configurer);
}
protected void makeActions(final IWorkbenchWindow window)
{
exitAction = ActionFactory.QUIT.create(window);
exitAction.setText("&\u9000\u51FA");
register(exitAction);
aboutAction = ActionFactory.ABOUT.create(window);
aboutAction.setText("\u5173\u4E8E");
register(aboutAction);
OpenFileAction = new OpenFileAction(window, "\u6253\u5F00\u4E00\u4E2A\u6587\u4EF6\u89C6\u56FE", "fileexplorer.views.ViewForFileContent");
register(OpenFileAction);
ExplorerAction = new Action() {
public void run()
{
IViewPart explorer = window.getActivePage().findView("fileexplorer.views.ViewForFileExplorer");
if(explorer != null)
{
window.getActivePage().bringToTop(explorer);
explorer.setFocus();
} else
{
try
{
window.getActivePage().showView("fileexplorer.views.ViewForFileExplorer");
}
catch(PartInitException e)
{
e.printStackTrace();
}
}
}
final ApplicationActionBarAdvisor this$0;
private final IWorkbenchWindow val$window;
{
this$0 = ApplicationActionBarAdvisor.this;
window = iworkbenchwindow;
super();
}
}
;
ExplorerAction.setToolTipText("\u6211\u7684\u7535\u8111");
ImageDescriptor niDes = ImageDescriptor.createFromFile(fileexplorer/ApplicationActionBarAdvisor, "/icons/1.gif");
ExplorerAction.setHoverImageDescriptor(niDes);
FileAction = new Action() {
public void run()
{
IViewPart file = window.getActivePage().findView("fileexplorer.views.ViewForFileContent");
if(file != null)
{
window.getActivePage().bringToTop(file);
file.setFocus();
} else
{
try
{
window.getActivePage().showView("fileexplorer.views.ViewForFileContent");
}
catch(PartInitException e)
{
e.printStackTrace();
}
}
}
final ApplicationActionBarAdvisor this$0;
private final IWorkbenchWindow val$window;
{
this$0 = ApplicationActionBarAdvisor.this;
window = iworkbenchwindow;
super();
}
}
;
FileAction.setToolTipText("\u6587\u4EF6\u89C6\u56FE");
ImageDescriptor piDes = ImageDescriptor.createFromFile(fileexplorer/ApplicationActionBarAdvisor, "/icons/file_obj.gif");
FileAction.setHoverImageDescriptor(piDes);
SearchAction = new Action() {
public void run()
{
IViewPart search = window.getActivePage().findView("fileexplorer.views.SearchView");
if(search != null)
{
window.getActivePage().bringToTop(search);
search.setFocus();
} else
{
try
{
window.getActivePage().showView("fileexplorer.views.SearchView");
}
catch(PartInitException e)
{
e.printStackTrace();
}
}
}
final ApplicationActionBarAdvisor this$0;
private final IWorkbenchWindow val$window;
{
this$0 = ApplicationActionBarAdvisor.this;
window = iworkbenchwindow;
super();
}
}
;
SearchAction.setToolTipText("\u641C\u7D22\u6587\u4EF6");
ImageDescriptor siDes = ImageDescriptor.createFromFile(fileexplorer/ApplicationActionBarAdvisor, "/icons/find_obj(1).gif");
SearchAction.setHoverImageDescriptor(siDes);
currentuserAction = new Action() {
public void run()
{
IViewPart currentuser = window.getActivePage().findView("fileexplorer.views.CurrentUserView");
if(currentuser != null)
{
window.getActivePage().bringToTop(currentuser);
currentuser.setFocus();
} else
{
try
{
window.getActivePage().showView("fileexplorer.views.CurrentUserView");
}
catch(PartInitException e)
{
e.printStackTrace();
}
}
}
final ApplicationActionBarAdvisor this$0;
private final IWorkbenchWindow val$window;
{
this$0 = ApplicationActionBarAdvisor.this;
window = iworkbenchwindow;
super();
}
}
;
currentuserAction.setToolTipText("\u5F53\u524D\u7528\u6237");
ImageDescriptor uiDes = ImageDescriptor.createFromFile(fileexplorer/ApplicationActionBarAdvisor, "/icons/debug_exc(1).gif");
currentuserAction.setHoverImageDescriptor(uiDes);
}
protected void fillMenuBar(IMenuManager menuBar)
{
MenuManager fileMenu = new MenuManager("&\u6587\u4EF6", "file");
menuBar.add(fileMenu);
fileMenu.add(OpenFileAction);
fileMenu.add(new Separator());
fileMenu.add(exitAction);
MenuManager helpMenu = new MenuManager("&\u5E2E\u52A9", "help");
menuBar.add(helpMenu);
helpMenu.add(aboutAction);
}
protected void fillCoolBar(ICoolBarManager coolBar)
{
IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle() | 0x400);
coolBar.add(toolbar);
ActionContributionItem explorerContactCI = new ActionContributionItem(ExplorerAction);
explorerContactCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolbar.add(explorerContactCI);
ActionContributionItem fileContactCI = new ActionContributionItem(FileAction);
fileContactCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolbar.add(fileContactCI);
ActionContributionItem searchContactCI = new ActionContributionItem(SearchAction);
searchContactCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolbar.add(searchContactCI);
ActionContributionItem userContactCI = new ActionContributionItem(currentuserAction);
userContactCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolbar.add(userContactCI);
coolBar.add(new Separator("additions"));
}
protected static void fillTrayItem(IMenuManager trayItem)
{
trayItem.add(aboutAction);
trayItem.add(exitAction);
}
private static org.eclipse.ui.actions.ActionFactory.IWorkbenchAction exitAction;
private static org.eclipse.ui.actions.ActionFactory.IWorkbenchAction aboutAction;
private Action ExplorerAction;
private Action FileAction;
private Action SearchAction;
private Action currentuserAction;
private Action OpenFileAction;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -