Minor code clean-up
diff --git a/org.eclipse.babel.editor.swt/build.properties b/org.eclipse.babel.editor.swt/build.properties index 4664e35..9515ff3 100644 --- a/org.eclipse.babel.editor.swt/build.properties +++ b/org.eclipse.babel.editor.swt/build.properties
@@ -3,4 +3,5 @@ bin.includes = META-INF/,\ .,\ fragment.xml,\ - OSGI-INF/l10n/bundle.properties + OSGI-INF/l10n/bundle.properties,\ + OSGI-INF/
diff --git a/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/internal/MessagesEditor.java b/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/internal/MessagesEditor.java index a5203e6..f504d76 100644 --- a/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/internal/MessagesEditor.java +++ b/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/internal/MessagesEditor.java
@@ -17,7 +17,6 @@ import org.eclipse.babel.core.message.internal.IMessagesBundleGroupListener; import org.eclipse.babel.core.message.internal.MessagesBundle; import org.eclipse.babel.core.message.internal.MessagesBundleGroupAdapter; -import org.eclipse.ui.editors.text.TextEditor; import org.eclipse.ui.texteditor.ITextEditor; public class MessagesEditor extends AbstractMessagesEditor {
diff --git a/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/refactoring/RenameKeyProcessor.java b/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/refactoring/RenameKeyProcessor.java index d477287..651b32a 100644 --- a/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/refactoring/RenameKeyProcessor.java +++ b/org.eclipse.babel.editor.swt/src/org/eclipse/babel/editor/refactoring/RenameKeyProcessor.java
@@ -16,7 +16,6 @@ import org.eclipse.babel.core.message.tree.internal.KeyTreeNode; import org.eclipse.babel.editor.plugin.MessagesEditorPlugin; import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; @@ -27,14 +26,13 @@ import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; import org.eclipse.ltk.core.refactoring.participants.RenameProcessor; -import org.eclipse.ltk.core.refactoring.participants.ResourceChangeChecker; import org.eclipse.ltk.core.refactoring.participants.SharableParticipants; /** * A rename processor for {@link IResource}. The processor will rename the * resource and load rename participants if references should be renamed as * well. - * + * * @since 3.4 */ public class RenameKeyProcessor extends RenameProcessor { @@ -52,7 +50,7 @@ /** * Creates a new rename resource processor. - * + * * @param keyNode * the resource to rename. * @param messagesBundleGroup @@ -72,7 +70,7 @@ /** * Returns the new key node - * + * * @return the new key node */ public KeyTreeNode getNewKeyTreeNode() { @@ -81,7 +79,7 @@ /** * Returns the new resource name - * + * * @return the new resource name */ public String getNewResourceName() { @@ -90,7 +88,7 @@ /** * Sets the new resource name - * + * * @param newName * the new resource name */ @@ -101,7 +99,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor) */ @@ -116,7 +114,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext) @@ -128,12 +126,13 @@ fRenameArguments = new RenameKeyArguments(getNewResourceName(), fRenameChildKeys, false); - ResourceChangeChecker checker = (ResourceChangeChecker) context - .getChecker(ResourceChangeChecker.class); - IResourceChangeDescriptionFactory deltaFactory = checker - .getDeltaFactory(); - // TODO figure out what we want to do here.... + + //ResourceChangeChecker checker = (ResourceChangeChecker) context + // .getChecker(ResourceChangeChecker.class); + //IResourceChangeDescriptionFactory deltaFactory = checker + // .getDeltaFactory(); + // ResourceModifications.buildMoveDelta(deltaFactory, fKeyNode, // fRenameArguments); @@ -147,7 +146,7 @@ * Validates if the a name is valid. This method does not change the name * settings on the refactoring. It is intended to be used in a wizard to * validate user input. - * + * * @param newName * the name to validate * @return returns the resulting status of the validation @@ -208,7 +207,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * createChange(org.eclipse.core.runtime.IProgressMonitor) */ @@ -227,7 +226,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * getElements() */ @@ -237,7 +236,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * getIdentifier() */ @@ -247,7 +246,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * getProcessorName() */ @@ -257,7 +256,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * isApplicable() */ @@ -269,7 +268,7 @@ /* * (non-Javadoc) - * + * * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor# * loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, * org.eclipse.ltk.core.refactoring.participants.SharableParticipants) @@ -288,7 +287,7 @@ /** * Returns <code>true</code> if the refactoring processor also renames the * child keys - * + * * @return <code>true</code> if the refactoring processor also renames the * child keys */ @@ -299,7 +298,7 @@ /** * Specifies if the refactoring processor also updates the child keys. The * default behaviour is to update the child keys. - * + * * @param renameChildKeys * <code>true</code> if the refactoring processor should also * rename the child keys
diff --git a/org.eclipse.babel.tapiji.tools.core.ui/src/org/eclipse/babel/tapiji/tools/core/ui/menus/InternationalizationMenu.java b/org.eclipse.babel.tapiji.tools.core.ui/src/org/eclipse/babel/tapiji/tools/core/ui/menus/InternationalizationMenu.java index 34149f0..1b98bce 100644 --- a/org.eclipse.babel.tapiji.tools.core.ui/src/org/eclipse/babel/tapiji/tools/core/ui/menus/InternationalizationMenu.java +++ b/org.eclipse.babel.tapiji.tools.core.ui/src/org/eclipse/babel/tapiji/tools/core/ui/menus/InternationalizationMenu.java
@@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Martin Reiterer - initial API and implementation ******************************************************************************/ @@ -242,6 +242,8 @@ protected void updateStateExclude(MenuItem menuItem) { Collection<IResource> resources = getSelectedResources(); + // TODO check resource type + menuItem.setEnabled(resources.size() > 0 && internationalizationEnabled); ResourceBundleManager manager = null; excludeMode = false;
diff --git a/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/Activator.java b/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/Activator.java index 8d7bdf9..46a5094 100644 --- a/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/Activator.java +++ b/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/Activator.java
@@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Martin Reiterer - initial API and implementation ******************************************************************************/ @@ -43,7 +43,7 @@ /* * (non-Javadoc) - * + * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext * ) @@ -59,7 +59,7 @@ /* * (non-Javadoc) - * + * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext * ) @@ -72,7 +72,7 @@ /** * Returns the shared instance - * + * * @return the shared instance */ public static Activator getDefault() { @@ -82,7 +82,7 @@ /** * Returns the string from the plugin's resource bundle, or 'key' if not * found. - * + * * @param key * the key for which to fetch a localized text * @return localized string corresponding to key @@ -99,7 +99,7 @@ /** * Returns the string from the plugin's resource bundle, or 'key' if not * found. - * + * * @param key * the key for which to fetch a localized text * @param arg1 @@ -107,13 +107,13 @@ * @return localized string corresponding to key */ public static String getString(String key, String arg1) { - return MessageFormat.format(getString(key), new String[] { arg1 }); + return MessageFormat.format(getString(key), new Object[] { arg1 }); } /** * Returns the string from the plugin's resource bundle, or 'key' if not * found. - * + * * @param key * the key for which to fetch a localized text * @param arg1 @@ -124,13 +124,13 @@ */ public static String getString(String key, String arg1, String arg2) { return MessageFormat - .format(getString(key), new String[] { arg1, arg2 }); + .format(getString(key), new Object[] { arg1, arg2 }); } /** * Returns the string from the plugin's resource bundle, or 'key' if not * found. - * + * * @param key * the key for which to fetch a localized text * @param arg1 @@ -143,13 +143,13 @@ */ public static String getString(String key, String arg1, String arg2, String arg3) { - return MessageFormat.format(getString(key), new String[] { arg1, arg2, + return MessageFormat.format(getString(key), new Object[] { arg1, arg2, arg3 }); } /** * Returns the plugin's resource bundle. - * + * * @return resource bundle */ protected ResourceBundle getResourceBundle() {
diff --git a/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/model/exception/NoSuchResourceAuditorException.java b/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/model/exception/NoSuchResourceAuditorException.java index 482de43..05f0eb8 100644 --- a/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/model/exception/NoSuchResourceAuditorException.java +++ b/org.eclipse.babel.tapiji.tools.core/src/org/eclipse/babel/tapiji/tools/core/model/exception/NoSuchResourceAuditorException.java
@@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Martin Reiterer - initial API and implementation ******************************************************************************/ @@ -12,4 +12,9 @@ public class NoSuchResourceAuditorException extends Exception { + /** + * default serial id + */ + private static final long serialVersionUID = 1L; + }