eclipse plugin: Rename 'Activator' into 'WesnothPlugin'
This commit is contained in:
parent
604c1f1c6d
commit
eb44860a66
17 changed files with 48 additions and 53 deletions
|
@ -52,7 +52,7 @@ import org.eclipse.ui.texteditor.IDocumentProvider;
|
|||
import org.eclipse.xtext.parsetree.LeafNode;
|
||||
import org.eclipse.xtext.ui.editor.XtextEditor;
|
||||
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingHelper;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Logger;
|
||||
import org.wesnoth.ui.Messages;
|
||||
import org.wesnoth.ui.WMLUiModule;
|
||||
|
@ -78,7 +78,7 @@ public class WMLEditor extends XtextEditor
|
|||
if (WMLUiModule.DEBUG)
|
||||
org.apache.log4j.Logger.getLogger(XtextEditor.class).setLevel(Level.DEBUG);
|
||||
// activate the wesnoth plugin
|
||||
Activator.getDefault();
|
||||
WesnothPlugin.getDefault();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: Wesnoth UMC Plugin
|
||||
Bundle-SymbolicName: org.wesnoth;singleton:=true
|
||||
Bundle-Version: 1.0.3
|
||||
Bundle-Activator: org.wesnoth.Activator
|
||||
Bundle-Activator: org.wesnoth.WesnothPlugin
|
||||
Bundle-Vendor: www.wesnoth.org
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
|
|
|
@ -25,15 +25,15 @@ import org.wesnoth.utils.WorkspaceUtils;
|
|||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin
|
||||
public class WesnothPlugin extends AbstractUIPlugin
|
||||
{
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
private static WesnothPlugin plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
public WesnothPlugin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,7 +79,7 @@ public class Activator extends AbstractUIPlugin
|
|||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault()
|
||||
public static WesnothPlugin getDefault()
|
||||
{
|
||||
return plugin;
|
||||
}
|
|
@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
|||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Logger;
|
||||
import org.wesnoth.Messages;
|
||||
import org.wesnoth.utils.GUIUtils;
|
||||
|
@ -29,7 +29,7 @@ public class UploadAddon extends ObjectActionDelegate
|
|||
public void run(IAction action)
|
||||
{
|
||||
final String fullPath = WorkspaceUtils.getSelectedResource().getLocation().toOSString();
|
||||
ProgressMonitorDialog dialog = new ProgressMonitorDialog(Activator.getShell());
|
||||
ProgressMonitorDialog dialog = new ProgressMonitorDialog(WesnothPlugin.getShell());
|
||||
try
|
||||
{
|
||||
dialog.run(false, false, new IRunnableWithProgress() {
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Map.Entry;
|
|||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.StringFieldEditor;
|
||||
import org.eclipse.xtext.ui.editor.preferences.fields.LabelFieldEditor;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.Messages;
|
||||
import org.wesnoth.jface.RegexStringFieldEditor;
|
||||
|
@ -34,7 +34,7 @@ public class AddonUploadPreferencePage extends AbstractPreferencePage
|
|||
ports_.put("15005", "1.4.x"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ports_.put("15004", "trunk"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
setPreferenceStore(Activator.getDefault().getPreferenceStore());
|
||||
setPreferenceStore(WesnothPlugin.getDefault().getPreferenceStore());
|
||||
setDescription(Messages.AddonUploadPreferencePage_10);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
package org.wesnoth.preferences;
|
||||
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.Messages;
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class AdvancedPreferencePage extends AbstractPreferencePage
|
|||
{
|
||||
super(GRID);
|
||||
|
||||
setPreferenceStore(Activator.getDefault().getPreferenceStore());
|
||||
setPreferenceStore(WesnothPlugin.getDefault().getPreferenceStore());
|
||||
setDescription(Messages.AdvancedPreferencePage_0);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ package org.wesnoth.preferences;
|
|||
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,7 @@ public class Preferences extends AbstractPreferenceInitializer
|
|||
@Override
|
||||
public void initializeDefaultPreferences()
|
||||
{
|
||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||
IPreferenceStore store = WesnothPlugin.getDefault().getPreferenceStore();
|
||||
// general settings
|
||||
store.setDefault(Constants.P_WESNOTH_EXEC_PATH, ""); //$NON-NLS-1$
|
||||
store.setDefault(Constants.P_WESNOTH_WORKING_DIR, ""); //$NON-NLS-1$
|
||||
|
@ -46,7 +46,7 @@ public class Preferences extends AbstractPreferenceInitializer
|
|||
store.setDefault(Constants.P_WAU_ADDRESS, "add-ons.wesnoth.org"); //$NON-NLS-1$
|
||||
store.setDefault(Constants.P_WAU_PORT, 15002);
|
||||
|
||||
// adnvaced
|
||||
// advanced
|
||||
store.setDefault(Constants.P_ADV_NO_TERRAIN_GFX, true);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class Preferences extends AbstractPreferenceInitializer
|
|||
*/
|
||||
public static IPreferenceStore getPreferences()
|
||||
{
|
||||
return Activator.getDefault().getPreferenceStore();
|
||||
return WesnothPlugin.getDefault().getPreferenceStore();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@ package org.wesnoth.preferences;
|
|||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.ScaleFieldEditor;
|
||||
import org.eclipse.xtext.ui.editor.preferences.fields.LabelFieldEditor;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.Messages;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class WMLToolsPreferencePage extends AbstractPreferencePage
|
|||
{
|
||||
super(GRID);
|
||||
|
||||
setPreferenceStore(Activator.getDefault().getPreferenceStore());
|
||||
setPreferenceStore(WesnothPlugin.getDefault().getPreferenceStore());
|
||||
setDescription(Messages.WMLToolsPreferencePage_0);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,28 +8,17 @@
|
|||
*******************************************************************************/
|
||||
package org.wesnoth.preferences;
|
||||
|
||||
import org.eclipse.jface.preference.PreferencePage;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
|
||||
public class WesnothInstallsPage extends PreferencePage implements IWorkbenchPreferencePage
|
||||
public class WesnothInstallsPage extends AbstractPreferencePage
|
||||
{
|
||||
|
||||
public WesnothInstallsPage()
|
||||
{
|
||||
}
|
||||
|
||||
public WesnothInstallsPage(String title)
|
||||
{
|
||||
super(title);
|
||||
}
|
||||
|
||||
public WesnothInstallsPage(String title, ImageDescriptor image)
|
||||
{
|
||||
super(title, image);
|
||||
setPreferenceStore(WesnothPlugin.getDefault().getPreferenceStore());
|
||||
setTitle("Wesnoth Installs Preferences");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,4 +31,10 @@ public class WesnothInstallsPage extends PreferencePage implements IWorkbenchPre
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFieldEditors()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.swt.events.ModifyEvent;
|
|||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.xtext.ui.editor.preferences.fields.LabelFieldEditor;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.Messages;
|
||||
import org.wesnoth.templates.ReplaceableParameter;
|
||||
|
@ -56,7 +56,7 @@ public class WesnothPreferencesPage extends AbstractPreferencePage
|
|||
public WesnothPreferencesPage() {
|
||||
super(GRID);
|
||||
|
||||
setPreferenceStore(Activator.getDefault().getPreferenceStore());
|
||||
setPreferenceStore(WesnothPlugin.getDefault().getPreferenceStore());
|
||||
setDescription(Messages.WesnothPreferencesPage_0);
|
||||
|
||||
wmlToolsList_ = new ArrayList<String>();
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.eclipse.core.resources.IResource;
|
|||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Logger;
|
||||
import org.wesnoth.Messages;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class MapUtils
|
|||
return;
|
||||
}
|
||||
|
||||
FileDialog mapDialog = new FileDialog(Activator.getShell(), SWT.OPEN);
|
||||
FileDialog mapDialog = new FileDialog(WesnothPlugin.getShell(), SWT.OPEN);
|
||||
mapDialog.setText(Messages.MapUtils_2);
|
||||
mapDialog.setFilterExtensions(new String[] {"*.map" }); //$NON-NLS-1$
|
||||
String file = mapDialog.open();
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.core.resources.IResource;
|
|||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.dialogs.DialogSettings;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.Logger;
|
||||
import org.wesnoth.Messages;
|
||||
|
@ -231,7 +231,7 @@ public class PreprocessorUtils
|
|||
*/
|
||||
public void saveTimestamps()
|
||||
{
|
||||
IPath path = Activator.getDefault().getStateLocation();
|
||||
IPath path = WesnothPlugin.getDefault().getStateLocation();
|
||||
String filename = path.append("preprocessed.txt").toOSString(); //$NON-NLS-1$
|
||||
DialogSettings settings = new DialogSettings("preprocessed"); //$NON-NLS-1$
|
||||
try
|
||||
|
@ -257,7 +257,7 @@ public class PreprocessorUtils
|
|||
*/
|
||||
public void restoreTimestamps()
|
||||
{
|
||||
IPath path = Activator.getDefault().getStateLocation();
|
||||
IPath path = WesnothPlugin.getDefault().getStateLocation();
|
||||
String filename = path.append("preprocessed.txt").toOSString(); //$NON-NLS-1$
|
||||
DialogSettings settings = new DialogSettings("preprocessed"); //$NON-NLS-1$
|
||||
filesTimeStamps_.clear();
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
|
|||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.jface.wizard.WizardDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.wizards.NewWizardTemplate;
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class WizardUtils
|
|||
if (wizard == null)
|
||||
return Window.CANCEL;
|
||||
|
||||
wizard.init(Activator.getDefault().getWorkbench(), selection);
|
||||
wizard.init(WesnothPlugin.getDefault().getWorkbench(), selection);
|
||||
wizard.setForcePreviousAndNextButtons(true);
|
||||
|
||||
WizardDialog wizardDialog = new WizardDialog(shell, wizard);
|
||||
|
@ -41,7 +41,7 @@ public class WizardUtils
|
|||
y += ((shell.getBounds().height - wizardDialog.getShell().getBounds().height)/2);
|
||||
wizardDialog.getShell().setLocation(x, y);
|
||||
wizardDialog.setHelpAvailable(true);
|
||||
Activator.getDefault().getWorkbench().getHelpSystem().setHelp(wizardDialog.getShell(),
|
||||
WesnothPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(wizardDialog.getShell(),
|
||||
"org.wesnoth.help.wizardHelp"); //$NON-NLS-1$
|
||||
|
||||
return wizardDialog.open();
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.eclipse.ui.IWorkbenchWindow;
|
|||
import org.eclipse.ui.IWorkingSet;
|
||||
import org.eclipse.ui.IWorkingSetManager;
|
||||
import org.eclipse.ui.dialogs.PreferencesUtil;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.Logger;
|
||||
import org.wesnoth.Messages;
|
||||
|
@ -215,7 +215,7 @@ public class WorkspaceUtils
|
|||
*/
|
||||
public static IWorkbench getWorkbench()
|
||||
{
|
||||
return Activator.getDefault().getWorkbench();
|
||||
return WesnothPlugin.getDefault().getWorkbench();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -335,7 +335,7 @@ public class WorkspaceUtils
|
|||
if (!checkConditions(false))
|
||||
{
|
||||
PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
|
||||
Activator.getShell(), "org.wesnoth.preferences.UMCPage", null, null); //$NON-NLS-1$
|
||||
WesnothPlugin.getShell(), "org.wesnoth.preferences.UMCPage", null, null); //$NON-NLS-1$
|
||||
if (pref.open() == Window.CANCEL || !checkConditions(true))
|
||||
{
|
||||
GUIUtils.showErrorMessageBox(Messages.WorkspaceUtils_7 +
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.jface.wizard.WizardPage;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Messages;
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class NewWizardPageTemplate extends WizardPage
|
|||
@Override
|
||||
public void createControl(Composite parent)
|
||||
{
|
||||
Activator.getDefault().getWorkbench().getHelpSystem().setHelp(getShell(),
|
||||
WesnothPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getShell(),
|
||||
"org.wesnoth.wizardHelp"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ package org.wesnoth.wizards.campaign;
|
|||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Messages;
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class CampaignPage0 extends WizardNewProjectCreationPage
|
|||
setTitle(Messages.CampaignPage0_1);
|
||||
setMessage(Messages.CampaignPage0_2);
|
||||
|
||||
Activator.getDefault().getWorkbench().getHelpSystem().setHelp(getShell(),
|
||||
WesnothPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getShell(),
|
||||
"org.wesnoth.wizardHelp"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ package org.wesnoth.wizards.emptyproject;
|
|||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
|
||||
import org.wesnoth.Activator;
|
||||
import org.wesnoth.WesnothPlugin;
|
||||
import org.wesnoth.Messages;
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class EmptyProjectPage0 extends WizardNewProjectCreationPage
|
|||
setTitle(Messages.EmptyProjectPage0_1);
|
||||
setMessage(Messages.EmptyProjectPage0_2);
|
||||
|
||||
Activator.getDefault().getWorkbench().getHelpSystem().setHelp(getShell(),
|
||||
WesnothPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getShell(),
|
||||
"org.wesnoth.wizardHelp"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue