Commit 0179c272 authored by Sebastian Pretscher's avatar Sebastian Pretscher

Removed sample action

parent 720e8af7
......@@ -2,30 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Sample Action Set"
visible="true"
id="CupPlugin.actionSet">
<menu
label="Sample &amp;Menu"
id="sampleMenu">
<separator
name="sampleGroup">
</separator>
</menu>
<action
label="&amp;Sample Action"
icon="icons/sample.gif"
class="cupplugin.actions.SampleAction"
tooltip="Hello, Eclipse world"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="sampleGroup"
id="cupplugin.actions.SampleAction">
</action>
</actionSet>
</extension>
<extension
point="org.eclipse.ui.editors">
<editor
......
package cupplugin.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.jface.dialogs.MessageDialog;
/**
* 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 SampleAction implements IWorkbenchWindowActionDelegate {
private IWorkbenchWindow window;
/**
* The constructor.
*/
public SampleAction() {
}
/**
* 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) {
MessageDialog.openInformation(
window.getShell(),
"CupPlugin",
"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) {
this.window = window;
}
}
\ No newline at end of file
......@@ -75,32 +75,6 @@ public class MultiPageEditor extends MultiPageEditorPart implements IResourceCha
e.getStatus());
}
}
/**
* Creates page 1 of the multi-page editor,
* which allows you to change the font used in page 2.
*/
void createPage1() {
Composite composite = new Composite(getContainer(), SWT.NONE);
GridLayout layout = new GridLayout();
composite.setLayout(layout);
layout.numColumns = 2;
Button fontButton = new Button(composite, SWT.NONE);
GridData gd = new GridData(GridData.BEGINNING);
gd.horizontalSpan = 2;
fontButton.setLayoutData(gd);
fontButton.setText("Change Font...");
fontButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
setFont();
}
});
int index = addPage(composite);
setPageText(index, "Properties");
}
/**
* Creates page 2 of the multi-page editor,
* which shows the sorted text.
......@@ -120,7 +94,6 @@ public class MultiPageEditor extends MultiPageEditorPart implements IResourceCha
*/
protected void createPages() {
createPage0();
createPage1();
createPage2();
}
/**
......@@ -177,7 +150,7 @@ public class MultiPageEditor extends MultiPageEditorPart implements IResourceCha
*/
protected void pageChange(int newPageIndex) {
super.pageChange(newPageIndex);
if (newPageIndex == 2) {
if (newPageIndex == 1) {
sortWords();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment