eclipse plugin: cleanup

- rename the eclipse plugin project so the id generation will be better

- add wesnoth projects view

- cleanup
This commit is contained in:
Timotei Dolean 2010-08-07 18:28:00 +00:00
parent 5212f70362
commit 04bd0e1686
7 changed files with 312 additions and 480 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Wesnoth Eclipse Plugin</name>
<name>wesnoth_eclipse_plugin</name>
<comment></comment>
<projects>
</projects>

View File

@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Wesnoth UMC Plugin
Bundle-SymbolicName: Wesnoth_Eclipse_Plugin; singleton:=true
Bundle-SymbolicName: wesnoth_eclipse_plugin;singleton:=true
Bundle-Version: 0.3.0
Bundle-Activator: wesnoth_eclipse_plugin.Activator
Bundle-Vendor: www.wesnoth.org
@ -15,7 +15,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.filesystem;bundle-version="1.2.1",
org.eclipse.ui.console;bundle-version="3.4.0",
org.eclipse.xtext.builder;bundle-version="1.0.0",
org.eclipse.xtext.ui;bundle-version="1.0.0"
org.eclipse.xtext.ui;bundle-version="1.0.0",
org.eclipse.ui.navigator;bundle-version="3.5.0",
org.eclipse.ui.navigator.resources
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.wesnoth.wml.core,
@ -33,7 +35,6 @@ Export-Package: org.wesnoth.wml.core,
wesnoth_eclipse_plugin.schema,
wesnoth_eclipse_plugin.templates,
wesnoth_eclipse_plugin.utils,
wesnoth_eclipse_plugin.views,
wesnoth_eclipse_plugin.wizards,
wesnoth_eclipse_plugin.wizards.campaign,
wesnoth_eclipse_plugin.wizards.emptyproject,

View File

@ -25,13 +25,280 @@
id="Wesnoth_Eclipse_Plugin.projectBuilder">
</builder>
</extension>
<extension
id="xmlProblem"
name="XML Problem"
point="org.eclipse.core.resources.markers">
<super
type="org.eclipse.core.resources.problemmarker">
</super>
<persistent
value="true">
</persistent>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.application"
point="org.eclipse.core.runtime.applications">
<application
icon="icons/wesnoth-icon_16.png"
thread="main"
visible="true">
<run
class="wesnoth_eclipse_plugin.product.Application">
</run>
</application>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="wesnoth_eclipse_plugin.preferences.Preferences">
</initializer>
</extension>
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
application="Wesnoth_Eclipse_Plugin.application"
name="Wesnoth User Made Content IDE">
<property
name="appName"
value="Wesnoth User Made Content IDE">
</property>
<property
name="preferenceCustomization"
value="plugin_customization.ini">
</property>
<property
name="startupMessageRect"
value="94,275,285,15">
</property>
<property
name="startupProgressRect"
value="94,260,100,15">
</property>
<property
name="startupForegroundColor"
value="000000">
</property>
</product>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.help"
point="org.eclipse.help.toc">
<toc
file="toc.xml"
primary="true">
</toc>
<toc
file="tocfeatures.xml">
</toc>
<toc
file="tocgettingstarted.xml">
</toc>
<toc
file="tocreference.xml">
</toc>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.contexts"
point="org.eclipse.help.contexts">
<contexts
file="contextHelp.xml"
plugin="Wesnoth_Eclipse_Plugin">
</contexts>
</extension>
<extension
point="org.eclipse.ui.editors">
<editor
default="true"
extensions="map"
icon="icons/wesnoth_editor-icon_16.png"
id="Wesnoth_Eclipse_Plugin.mapFileEditor"
launcher="wesnoth_eclipse_plugin.editors.MapFileEditor"
name="Map files editor">
</editor>
<editor
default="false"
id="Wesnoth Eclipse Plugin.editor2"
name="name">
</editor>
</extension>
<extension
point="org.eclipse.ui.newWizards">
<category
id="wesnoth.eclipse.newWizards"
name="Wesnoth">
</category>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.emptyproject.EmptyProjectNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.emptyProjectWizard"
name="Empty project"
project="true">
<description>
Creates a new empty project
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.campaign.CampaignNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizards.CampaignNewWizard"
name="Wesnoth Campaign"
project="true">
<description>
Create a Wesnoth campaign.
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.scenario.ScenarioNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizards.ScenarioNewWizard"
name="Wesnoth Scenario"
project="false">
<description>
Create a Wesnoth single player or multiplayer scenario.
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.era.EraNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizards.eraNewWizard"
name="Wesnoth Era"
project="false">
<description>
Create a new wesnoth era.
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.faction.FactionNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.factionNewWizard"
name="Wesnoth Faction"
project="false">
<description>
Create a new Wesnoth faction.
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.generator.WizardLauncher"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.wizardLauncher"
name="Wizard Launcher"
project="false">
<description>
Launches the wizard based on the selected tag.
</description>
</wizard>
</extension>
<extension
point="org.eclipse.ui.views">
<category
name="Wesnoth"
id="Wesnoth_Eclipse_Plugin.view_category">
</category>
<view
allowMultiple="false"
category="Wesnoth_Eclipse_Plugin.view_category"
class="org.eclipse.ui.navigator.CommonNavigator"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.views.projects"
name="Wesnoth Projects"
restorable="true">
</view>
</extension>
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<commonFilter
activeByDefault="true"
id="wesnoth_eclipse_plugin.navigator.filters.hideAutoLinkedProject"
name="Hide Autolinked CFG Projects">
<filterExpression>
<or>
<adapt
type="org.eclipse.core.resources.IProject">
<test
property="org.eclipse.core.resources.name"
value="_AutoLinked_CFGExternalFiles_">
</test>
</adapt>
</or></filterExpression>
</commonFilter>
<navigatorContent
activeByDefault="true"
id="wesnoth_eclipse_plugin.navigator.wmlProjectDataCore"
name="Core"
priority="highest">
<triggerPoints>
<or>
<and>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof></and>
</or></triggerPoints>
</navigatorContent>
<commonFilter
activeByDefault="true"
id="wesnoth_eclipse_plugin.navigator.filters.buildxml"
name="Hide build.xml">
<filterExpression>
<or>
<adapt
type="org.eclipse.core.resources.IFile">
<test
property="org.eclipse.core.resources.name"
value="build.xml">
</test>
</adapt>
</or>
</filterExpression>
</commonFilter>
</extension>
<extension
point="org.eclipse.ui.navigator.viewer">
<viewer
viewerId="wesnoth_eclipse_plugin.views.projects">
</viewer>
<viewerContentBinding
viewerId="wesnoth_eclipse_plugin.views.projects">
<includes>
<contentExtension
pattern="org.eclipse.ui.navigator.resourceContent">
</contentExtension>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.filters.startsWithDot">
</contentExtension>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.filters.closedProject">
</contentExtension>
<contentExtension
pattern="wesnoth_eclipse_plugin.navigator.filters.*">
</contentExtension>
</includes>
</viewerContentBinding>
<viewerActionBinding
viewerId="wesnoth_eclipse_plugin.views.projects">
<includes>
<actionExtension
pattern="org.eclipse.ui.navigator.resources.*">
</actionExtension>
</includes>
</viewerActionBinding>
</extension>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="false"
objectClass="org.eclipse.core.resources.IProject"
adaptable="true"
id="plugin.projectContributions"
nameFilter="*"
id="plugin.projectContributions">
objectClass="org.eclipse.core.resources.IProject">
<action
class="wesnoth_eclipse_plugin.builder.ToggleNatureAction"
enablesFor="+"
@ -47,6 +314,12 @@
label="Wesnoth project report"
menubarPath="_wesnoth">
</action>
<visibility>
<objectState
name="projectNature"
value="Wesnoth_Eclipse_Plugin.wesnothNature">
</objectState>
</visibility>
</objectContribution>
<objectContribution
adaptable="false"
@ -61,6 +334,12 @@
label="Import map"
menubarPath="_wesnoth">
</action>
<visibility>
<objectState
name="projectNature"
value="Wesnoth_Eclipse_Plugin.wesnothNature">
</objectState>
</visibility>
</objectContribution>
<objectContribution
adaptable="false"
@ -75,6 +354,12 @@
label="Open map in editor"
menubarPath="_wesnoth">
</action>
<visibility>
<objectState
name="projectNature"
value="Wesnoth_Eclipse_Plugin.wesnothNature">
</objectState>
</visibility>
</objectContribution>
<objectContribution
adaptable="false"
@ -125,14 +410,6 @@
label="Run &quot;wmllint&quot; on this file"
menubarPath="plugin.wmltoolsCfgMenu/wmltoolsCfgMenuMarker">
</action>
<!--
<action
class="wesnoth_eclipse_plugin.action.RunWMLLintOnPreprocFile"
id="action.cfg.wmllintOnPreprocFile"
label="Run &quot;wmllint&quot; on preprocessed file"
menubarPath="plugin.wmltoolsCfgMenu/wmltoolsCfgMenuMarker">
</action>
-->
<action
class="wesnoth_eclipse_plugin.action.RunWMLScopeOnSelection"
id="action.cfg.wmlscope"
@ -145,6 +422,12 @@
label="Run &quot;wmlindent&quot; on this file"
menubarPath="plugin.wmltoolsCfgMenu/wmltoolsCfgMenuMarker">
</action>
<visibility>
<objectState
name="projectNature"
value="Wesnoth_Eclipse_Plugin.wesnothNature">
</objectState>
</visibility>
</objectContribution>
<objectContribution
adaptable="false"
@ -192,157 +475,14 @@
label="Run &quot;wmllint&quot; on the container"
menubarPath="plugin.wmltoolsContainerMenu/wmltoolsContainerMenuMarker">
</action>
<visibility>
<objectState
name="projectNature"
value="Wesnoth_Eclipse_Plugin.wesnothNature">
</objectState>
</visibility>
</objectContribution>
</extension>
<extension
id="xmlProblem"
name="XML Problem"
point="org.eclipse.core.resources.markers">
<super
type="org.eclipse.core.resources.problemmarker">
</super>
<persistent
value="true">
</persistent>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.help"
point="org.eclipse.help.toc">
<toc
file="toc.xml"
primary="true">
</toc>
<toc
file="tocfeatures.xml">
</toc>
<toc
file="tocgettingstarted.xml">
</toc>
<toc
file="tocreference.xml">
</toc>
</extension>
<extension
point="org.eclipse.ui.views">
<!--
<category
name="Sample Category"
id="Wesnoth_Eclipse_Plugin">
</category>
<view
name="Wesnoth View"
icon="icons/wesnoth-icon_16.png"
category="Wesnoth_Eclipse_Plugin"
class="wesnoth_eclipse_plugin.views.SampleView"
id="wesnoth_eclipse_plugin.views.SampleView">
</view>
-->
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<!--
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
ratio="0.5"
relative="org.eclipse.ui.views.TaskList"
relationship="right"
id="wesnoth_eclipse_plugin.views.SampleView">
</view>
</perspectiveExtension>
-->
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.contexts"
point="org.eclipse.help.contexts">
<contexts
file="contextHelp.xml"
plugin="Wesnoth_Eclipse_Plugin">
</contexts>
</extension>
<extension
point="org.eclipse.ui.newWizards">
<category name="Wesnoth"
id="wesnoth.eclipse.newWizards">
</category>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.emptyproject.EmptyProjectNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.emptyProjectWizard"
name="Empty project"
project="true">
<description>
Creates a new empty project
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.campaign.CampaignNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizards.CampaignNewWizard"
name="Wesnoth Campaign"
project="true">
<description>Create a Wesnoth campaign.</description>
</wizard>
<wizard name="Wesnoth Scenario"
icon="icons/wesnoth-icon_16.png"
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.scenario.ScenarioNewWizard"
id="wesnoth_eclipse_plugin.wizards.ScenarioNewWizard"
project="false">
<description>Create a Wesnoth single player or multiplayer scenario.</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.era.EraNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizards.eraNewWizard"
name="Wesnoth Era"
project="false">
<description>
Create a new wesnoth era.
</description>
</wizard>
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.faction.FactionNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.factionNewWizard"
name="Wesnoth Faction"
project="false">
<description>
Create a new Wesnoth faction.
</description>
</wizard>
<!--
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.unit.UnitsNewWizard"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.unitNewWizard"
name="Wesnoth Unit"
project="false">
<description>
Creates a new unit
</description>
</wizard>
-->
<wizard
category="wesnoth.eclipse.newWizards"
class="wesnoth_eclipse_plugin.wizards.generator.WizardLauncher"
icon="icons/wesnoth-icon_16.png"
id="wesnoth_eclipse_plugin.wizard.wizardLauncher"
name="Wizard Launcher"
project="false">
<description>
Launches the wizard based on the selected tag.
</description>
</wizard>
</extension>
<extension
point="org.eclipse.ui.commands">
<category
@ -484,68 +624,6 @@
name="Addon Uploader">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="wesnoth_eclipse_plugin.preferences.Preferences">
</initializer>
</extension>
<extension
point="org.eclipse.ui.editors">
<editor
default="true"
extensions="map"
icon="icons/wesnoth_editor-icon_16.png"
id="Wesnoth_Eclipse_Plugin.mapFileEditor"
launcher="wesnoth_eclipse_plugin.editors.MapFileEditor"
name="Map files editor">
</editor>
<editor
default="false"
id="Wesnoth Eclipse Plugin.editor2"
name="name">
</editor>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.application"
point="org.eclipse.core.runtime.applications">
<application
icon="icons/wesnoth-icon_16.png"
thread="main"
visible="true">
<run
class="wesnoth_eclipse_plugin.product.Application">
</run>
</application>
</extension>
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
application="Wesnoth_Eclipse_Plugin.application"
name="Wesnoth User Made Content IDE">
<property
name="appName"
value="Wesnoth User Made Content IDE">
</property>
<property
name="preferenceCustomization"
value="plugin_customization.ini">
</property>
<property
name="startupMessageRect"
value="94,275,285,15">
</property>
<property
name="startupProgressRect"
value="94,260,100,15">
</property>
<property
name="startupForegroundColor"
value="000000">
</property>
</product>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.perspectives"
point="org.eclipse.ui.perspectives">
@ -553,8 +631,11 @@
class="wesnoth_eclipse_plugin.product.WMLPerspective"
icon="icons/wesnoth_editor-icon_16.png"
id="Wesnoth_Eclipse_Plugin.product.perspective"
name="Default Perspective">
name="Wesnoth">
</perspective>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
</extension>
</plugin>

View File

@ -1,250 +0,0 @@
package wesnoth_eclipse_plugin.views;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
/**
* This sample class demonstrates how to plug-in a new
* workbench view. The view shows data obtained from the
* model. The sample creates a dummy model on the fly,
* but a real implementation would connect to the model
* available either in this or another plug-in (e.g. the workspace).
* The view is connected to the model using a content provider.
* <p>
* The view uses a label provider to define how model
* objects should be presented in the view. Each
* view can present the same model objects using
* different labels and icons, if needed. Alternatively,
* a single label provider can be shared between views
* in order to ensure that objects of the same type are
* presented in the same way everywhere.
* <p>
*/
public class SampleView extends ViewPart
{
/**
* The ID of the view as specified by the extension.
*/
public static final String ID = "wesnoth_eclipse_plugin.views.SampleView";
private TableViewer viewer;
private Action action1;
private Action action2;
private Action doubleClickAction;
/*
* The content provider class is responsible for
* providing objects to the view. It can wrap
* existing objects in adapters or simply return
* objects as-is. These objects may be sensitive
* to the current input of the view, or ignore
* it and always show the same content
* (like Task List, for example).
*/
class ViewContentProvider implements IStructuredContentProvider
{
@Override
public void inputChanged(Viewer v, Object oldInput, Object newInput)
{
}
@Override
public void dispose()
{
}
@Override
public Object[] getElements(Object parent)
{
return new String[] { "One", "Two", "Three" };
}
}
class ViewLabelProvider extends LabelProvider implements ITableLabelProvider
{
@Override
public String getColumnText(Object obj, int index)
{
return getText(obj);
}
@Override
public Image getColumnImage(Object obj, int index)
{
return getImage(obj);
}
@Override
public Image getImage(Object obj)
{
return PlatformUI.getWorkbench().
getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
}
}
class NameSorter extends ViewerSorter
{
}
/**
* The constructor.
*/
public SampleView() {
}
/**
* This is a callback that will allow us
* to create the viewer and initialize it.
*/
@Override
public void createPartControl(Composite parent)
{
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
viewer.setSorter(new NameSorter());
viewer.setInput(getViewSite());
// Create the help context id for the viewer's control
PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "Wesnoth_Eclipse_Plugin.viewer");
makeActions();
hookContextMenu();
hookDoubleClickAction();
contributeToActionBars();
}
private void hookContextMenu()
{
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager)
{
SampleView.this.fillContextMenu(manager);
}
});
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, viewer);
}
private void contributeToActionBars()
{
IActionBars bars = getViewSite().getActionBars();
fillLocalPullDown(bars.getMenuManager());
fillLocalToolBar(bars.getToolBarManager());
}
private void fillLocalPullDown(IMenuManager manager)
{
manager.add(action1);
manager.add(new Separator());
manager.add(action2);
}
private void fillContextMenu(IMenuManager manager)
{
manager.add(action1);
manager.add(action2);
// Other plug-ins can contribute there actions here
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
private void fillLocalToolBar(IToolBarManager manager)
{
manager.add(action1);
manager.add(action2);
}
private void makeActions()
{
action1 = new Action() {
@Override
public void run()
{
showMessage("Action 1 executed");
}
};
action1.setText("Action 1");
action1.setToolTipText("Action 1 tooltip");
action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
action2 = new Action() {
@Override
public void run()
{
showMessage("Action 2 executed");
}
};
action2.setText("Action 2");
action2.setToolTipText("Action 2 tooltip");
action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
doubleClickAction = new Action() {
@Override
public void run()
{
ISelection selection = viewer.getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
showMessage("Double-click detected on " + obj.toString());
}
};
}
private void hookDoubleClickAction()
{
viewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event)
{
doubleClickAction.run();
}
});
}
private void showMessage(String message)
{
MessageDialog.openInformation(
viewer.getControl().getShell(),
"Sample View",
message);
}
/**
* Passing the focus request to the viewer's control.
*/
@Override
public void setFocus()
{
viewer.getControl().setFocus();
}
}

View File

@ -14,7 +14,7 @@ Require-Bundle: org.wesnoth.wml;visibility:=reexport,
org.eclipse.xtext.builder,
org.antlr.runtime,
org.eclipse.xtext.xtext.ui;bundle-version="1.0.0",
Wesnoth_Eclipse_Plugin;bundle-version="0.3.0",
wesnoth_eclipse_plugin;bundle-version="0.3.0",
org.eclipse.core.filesystem;bundle-version="1.3.0",
org.eclipse.jdt.core;bundle-version="3.6.0"
Import-Package: org.apache.log4j

View File

@ -62,7 +62,7 @@ import com.google.inject.Inject;
public class WMLEditor extends XtextEditor
{
protected static final String AUTOLINK_PROJECT_NAME = "__AutoLinked_CFGExternalFiles";
protected static final String AUTOLINK_PROJECT_NAME = "_AutoLinked_CFGExternalFiles_";
protected static final String ENCODING_UTF8 = "utf-8";
protected IHighlightingHelper highlightingHelper_;

View File

@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.xtext,
org.eclipse.emf.ecore,
org.eclipse.emf.common,
org.antlr.runtime,
Wesnoth_Eclipse_Plugin;bundle-version="0.3.0"
wesnoth_eclipse_plugin;bundle-version="0.3.0"
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.wesnoth,