|
From: Matthias K <mat...@us...> - 2006-07-08 17:35:09
|
Update of /cvsroot/jcommander/plugins/org.jcommander.ui.editor/src/org/jcommander/ui/editor/actions In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2671/src/org/jcommander/ui/editor/actions Added Files: CloseAction.java Removed Files: SampleAction.java Log Message: - [Feature Requests-1105827]: First implementation of simple build in editor, currently capable of highlighting html and xml - removed compare perspective, now using edit instead - All Editors can be closed with Esc --- NEW FILE: CloseAction.java --- package org.jcommander.ui.editor.actions; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowActionDelegate; import org.eclipse.ui.PlatformUI; /** * Our sample action implements workbench action delegate. * The action proxy will be created by the workbench and * shown in the UI. When the user tries to use the action, * this delegate will be created and execution will be * delegated to it. * @see IWorkbenchWindowActionDelegate */ public class CloseAction implements IWorkbenchWindowActionDelegate { /** * The constructor. */ public CloseAction() { } /** * The action has been activated. The argument of the * method represents the 'real' action sitting * in the workbench UI. * @see IWorkbenchWindowActionDelegate#run */ public void run(IAction action) { IWorkbenchPage page =PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); page.closeEditor(page.getActiveEditor(), false); // MessageDialog.openInformation( // window.getShell(), // "JCommander Editor Plug-in", // "Hello, Eclipse world"); } /** * Selection in the workbench has been changed. We * can change the state of the 'real' action here * if we want, but this can only happen after * the delegate has been created. * @see IWorkbenchWindowActionDelegate#selectionChanged */ public void selectionChanged(IAction action, ISelection selection) { } /** * We can use this method to dispose of any system * resources we previously allocated. * @see IWorkbenchWindowActionDelegate#dispose */ public void dispose() { } /** * We will cache window object in order to * be able to provide parent shell for the message dialog. * @see IWorkbenchWindowActionDelegate#init */ public void init(IWorkbenchWindow window) { } } --- SampleAction.java DELETED --- |