diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-03-26 14:32:47 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-03-26 14:32:47 -0230 |
commit | 454c03e66a16a6d733163e67e317fbf565b5cdbf (patch) | |
tree | 7ecc45eecd24a65bf5bc81af2a48621d80b58caf /eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences | |
parent | Updated .gitignore files (diff) | |
download | ice-454c03e66a16a6d733163e67e317fbf565b5cdbf.tar.bz2 ice-454c03e66a16a6d733163e67e317fbf565b5cdbf.tar.xz ice-454c03e66a16a6d733163e67e317fbf565b5cdbf.zip |
ICE-6396 Move eclipse plugin to its own repo
Diffstat (limited to 'eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences')
4 files changed, 0 insertions, 194 deletions
diff --git a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/Messages.java b/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/Messages.java deleted file mode 100644 index 3165bbe3143..00000000000 --- a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/Messages.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zeroc.slice2javaplugin.preferences; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS -{ - private static final String BUNDLE_NAME = "com.zeroc.slice2javaplugin.preferences.messages"; //$NON-NLS-1$ - public static String IceStringVersion; - static - { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() - { - } -} diff --git a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/PluginPreferencePage.java b/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/PluginPreferencePage.java deleted file mode 100644 index 56c20377727..00000000000 --- a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/PluginPreferencePage.java +++ /dev/null @@ -1,102 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. -// -// This plug-in is provided to you under the terms and conditions -// of the Eclipse Public License Version 1.0 ("EPL"). A copy of -// the EPL is available at http://www.eclipse.org/legal/epl-v10.html. -// -// ********************************************************************** - -package com.zeroc.slice2javaplugin.preferences; - -import org.eclipse.jface.preference.*; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.IWorkbench; - -import com.zeroc.slice2javaplugin.Activator; -import com.zeroc.slice2javaplugin.internal.Configuration; - -/** - * This class represents a preference page that is contributed to the - * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we - * can use the field support built into JFace that allows us to create a page - * that is small and knows how to save, restore and apply itself. - * <p> - * This page is used to modify preferences only. They are stored in the - * preference store that belongs to the main plug-in class. That way, - * preferences can be accessed directly via the preference store. - */ - -public class PluginPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage -{ - public static final String SDK_PATH = "pathPreference"; - - public PluginPreferencePage() - { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Slice2Java Preferences"); - } - - /** - * Creates the field editors. Field editors are abstractions of the common - * GUI blocks needed to manipulate various types of preferences. Each field - * editor knows how to save and restore itself. - */ - public void createFieldEditors() - { - addField(new SdkDirectoryFieldEditor(SDK_PATH, "&SDK Location:", getFieldEditorParent())); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init(IWorkbench workbench) - { - } - - private static class SdkDirectoryFieldEditor extends DirectoryFieldEditor - { - - public SdkDirectoryFieldEditor(String name, String labelText, Composite parent) - { - super(name, labelText, parent); - setEmptyStringAllowed(false); - } - - /** - * Method declared on StringFieldEditor and overridden in - * DirectoryFieldEditor. Checks whether the text input field contains a - * valid directory. - * - * @return True if the apply/ok button should be enabled in the pref - * panel - */ - @Override - protected boolean doCheckState() - { - String dir = getTextControl().getText(); - dir = dir.trim(); - if(!Configuration.verifyIceHome(dir)) - { - setErrorMessage("Invalid SDK Location"); - return false; - } - clearMessage(); - return true; - } - - @Override - public Text getTextControl(Composite parent) - { - setValidateStrategy(VALIDATE_ON_KEY_STROKE); - return super.getTextControl(parent); - } - } -} diff --git a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/PreferenceInitializer.java b/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/PreferenceInitializer.java deleted file mode 100644 index 10e66e7dccc..00000000000 --- a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/PreferenceInitializer.java +++ /dev/null @@ -1,73 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. -// -// This plug-in is provided to you under the terms and conditions -// of the Eclipse Public License Version 1.0 ("EPL"). A copy of -// the EPL is available at http://www.eclipse.org/legal/epl-v10.html. -// -// ********************************************************************** - -package com.zeroc.slice2javaplugin.preferences; - -import java.io.File; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; - -import com.zeroc.slice2javaplugin.Activator; - -/** - * Class used to initialize default preference values. - */ -public class PreferenceInitializer extends AbstractPreferenceInitializer -{ - private String getDefaultHome() - { - String os = System.getProperty("os.name"); //$NON-NLS-1$ - if(os.startsWith("Windows")) //$NON-NLS-1$ - { - final String[] defaultLocations = new String[]{ - "C:\\Program Files\\ZeroC\\Ice-" + Messages.IceStringVersion, - "C:\\Program Files (x86)\\ZeroC\\Ice-" + Messages.IceStringVersion, - "C:\\Ice-" + Messages.IceStringVersion}; - for(String s : defaultLocations) - { - if(new File(s).exists()) - { - return s; - } - } - } - else - { - final String[] defaultLocations = new String[]{ - "/usr/bin/slice2java", - "/usr/local/bin/slice2java", - "/opt/Ice-" + Messages.IceStringVersion + "/bin/slice2java"}; - - for(String s : defaultLocations) - { - if(new File(s).exists()) - { - return s.replace("/bin/slice2java", ""); - } - } - } - return "/opt/Ice-" + Messages.IceStringVersion; //$NON-NLS-1$ - } - - /* - * (non-Javadoc) - * - * @seeorg.eclipse.core.runtime.preferences.AbstractPreferenceInitializer# - * initializeDefaultPreferences() - */ - public void initializeDefaultPreferences() - { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - - store.setDefault(PluginPreferencePage.SDK_PATH, getDefaultHome() ); - } - -} diff --git a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/messages.properties b/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/messages.properties deleted file mode 100644 index 296b4aa0760..00000000000 --- a/eclipse/java/Slice2javaPlugin/src/com/zeroc/slice2javaplugin/preferences/messages.properties +++ /dev/null @@ -1 +0,0 @@ -IceStringVersion=3.6.0 |