diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/ILocalTerminalSettings.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/ILocalTerminalSettings.java index a253a3568de..c4ef10b5f22 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/ILocalTerminalSettings.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/ILocalTerminalSettings.java @@ -11,7 +11,7 @@ package org.eclipse.tm.internal.terminal.local; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; /** * The interface {@link ILocalTerminalSettings} defines the public interface for connector-specific @@ -47,7 +47,7 @@ public interface ILocalTerminalSettings { * * @param store the {@link ISettings} to load the settings from */ - public abstract void load(ISettings store); + public abstract void load(ISettingsStore store); /** * Saves the settings to a specified {@link ISettings}. @@ -57,7 +57,7 @@ public interface ILocalTerminalSettings { * * @param store the {@link ISettings} for storing the settings */ - public abstract void save(ISettings store); + public abstract void save(ISettingsStore store); /** * Gets the name of the launch configuration that will be started in the terminal. diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalConnector.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalConnector.java index aee9f24cad8..52f59f710b0 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalConnector.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalConnector.java @@ -41,7 +41,7 @@ import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcess; import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcessFactory; import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcessRegistry; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; @@ -120,7 +120,7 @@ implements IDebugEventSetListener { * by the framework in a uniform way. Maybe a configuration mechanism using attributes * (like, for example, ILaunchConfiguration) might be beneficial here. */ - public void load(ISettings store) { + public void load(ISettingsStore store) { settings.load(store); } @@ -133,7 +133,7 @@ implements IDebugEventSetListener { * * @see TerminalConnectorImpl#save(ISettings) */ - public void save(ISettings store) { + public void save(ISettingsStore store) { settings.save(store); } diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputListener.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputListener.java index b6d0c734677..3e9ff6bb1ae 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputListener.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputListener.java @@ -12,6 +12,7 @@ package org.eclipse.tm.internal.terminal.local; import java.io.PrintStream; + import org.eclipse.debug.core.IStreamListener; import org.eclipse.debug.core.model.IStreamMonitor; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputStream.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputStream.java index 1bdcb1587b2..3005eddadd8 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputStream.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalOutputStream.java @@ -13,6 +13,7 @@ package org.eclipse.tm.internal.terminal.local; import java.io.IOException; import java.io.OutputStream; + import org.eclipse.debug.core.model.IProcess; import org.eclipse.debug.core.model.IStreamsProxy; import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcess; diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalSettings.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalSettings.java index ee96afc1385..6f27d26fba3 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalSettings.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/LocalTerminalSettings.java @@ -12,7 +12,8 @@ package org.eclipse.tm.internal.terminal.local; import java.lang.reflect.Field; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; + +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.Logger; /** @@ -38,14 +39,14 @@ public class LocalTerminalSettings implements ILocalTerminalSettings { * @param store the {@link ISettings} * @see ILocalTerminalSettings#load(ISettings) */ - public void load(ISettings store) { + public void load(ISettingsStore store) { Field[] declaredField = getClass().getDeclaredFields(); int numberOfFields = declaredField.length; for (int index = 0; index < numberOfFields; index++) { Field field = declaredField[index]; - Class type = field.getType(); + Class type = field.getType(); Object value = store.get(field.getName()); if (type.equals(boolean.class)) { @@ -71,7 +72,7 @@ public class LocalTerminalSettings implements ILocalTerminalSettings { * * @see ILocalTerminalSettings#save(ISettings) */ - public void save(ISettings store) { + public void save(ISettingsStore store) { Field[] declaredField = getClass().getDeclaredFields(); int numberOfFields = declaredField.length; @@ -81,7 +82,7 @@ public class LocalTerminalSettings implements ILocalTerminalSettings { try { field.setAccessible(true); - store.set(field.getName(), String.valueOf(field.get(this))); + store.put(field.getName(), String.valueOf(field.get(this))); } catch (IllegalAccessException illegalAccess) { diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchDelegate.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchDelegate.java index 23ad9ede7b6..999371af27b 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchDelegate.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchDelegate.java @@ -80,7 +80,6 @@ public class LocalTerminalLaunchDelegate extends LaunchConfigurationDelegate { * @param launch the {@link ILaunch} object * @exception CoreException if launching fails */ - @SuppressWarnings("deprecation") public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor progressMonitor) throws CoreException { @@ -181,7 +180,7 @@ public class LocalTerminalLaunchDelegate extends LaunchConfigurationDelegate { // Use program name as "process type" attribute: // - Map processAttributes = new HashMap(); + Map processAttributes = new HashMap(); String programName = location.lastSegment(); String extension = location.getFileExtension(); if (extension != null) { diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchUtilities.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchUtilities.java index c13bf5124ed..79db5cd278f 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchUtilities.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalLaunchUtilities.java @@ -66,7 +66,7 @@ public class LocalTerminalLaunchUtilities { private final static String STRING = null; private final static String TERM = "TERM"; //$NON-NLS-1$ private final static String ANSI = "ansi"; //$NON-NLS-1$ - private final static Map TERM_ANSI = Collections.singletonMap(TERM, ANSI); + private final static Map TERM_ANSI = Collections.singletonMap(TERM, ANSI); // These constants were copied from IExternalToolConstants to avoid references to internal API: // @@ -242,7 +242,7 @@ public class LocalTerminalLaunchUtilities { name = terminalLaunchName.format(new Object[] {name}); name = manager.generateLaunchConfigurationName(name); workingCopy = LocalTerminalUtilities.TERMINAL_LAUNCH_TYPE.newInstance(null, name); - workingCopy.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, new HashMap(TERM_ANSI)); + workingCopy.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, new HashMap(TERM_ANSI)); workingCopy.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true); workingCopy.setAttribute(ATTR_LOCATION, defaultShell); workingCopy.setAttribute(ATTR_WORKING_DIRECTORY, userHome); diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalStillRunningListener.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalStillRunningListener.java index e9224561e66..17478b61e85 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalStillRunningListener.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/launch/LocalTerminalStillRunningListener.java @@ -13,6 +13,7 @@ package org.eclipse.tm.internal.terminal.local.launch; import java.util.ArrayList; import java.util.List; + import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; @@ -81,7 +82,7 @@ public class LocalTerminalStillRunningListener implements IWorkbenchListener { return true; } - List notTerminated = new ArrayList(); + List notTerminated = new ArrayList(); ILaunch launches[] = LocalTerminalUtilities.LAUNCH_MANAGER.getLaunches(); ILaunchConfigurationType configurationType; ILaunchConfiguration configuration; @@ -109,7 +110,7 @@ public class LocalTerminalStillRunningListener implements IWorkbenchListener { if (!notTerminated.isEmpty()) { IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); - ILaunch[] launch = notTerminated.toArray(new ILaunch[notTerminated.size()]); + ILaunch[] launch = (ILaunch[])notTerminated.toArray(new ILaunch[notTerminated.size()]); return LocalTerminalStillRunningDialog.openDialog(window.getShell(), launch); } return true; diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcess.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcess.java index 2320222d47c..3b4b6b1c28d 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcess.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcess.java @@ -70,7 +70,6 @@ import org.eclipse.debug.core.model.RuntimeProcess; * @author Mirko Raner * @version $Revision: 1.2 $ */ -@SuppressWarnings("restriction") public final class LocalTerminalProcess extends RuntimeProcess { /** @@ -90,7 +89,7 @@ public final class LocalTerminalProcess extends RuntimeProcess { * @param name the process name * @param attributes additional attributes of the process */ - protected LocalTerminalProcess(ILaunch launch, Process process, String name, Map attributes) { + protected LocalTerminalProcess(ILaunch launch, Process process, String name, Map attributes) { super(launch, process, name, setProcessType(attributes)); enableStreamsProxy = true; @@ -174,7 +173,7 @@ public final class LocalTerminalProcess extends RuntimeProcess { //------------------------------------- PRIVATE SECTION --------------------------------------// - private static Map setProcessType(Map attributes) { + private static Map setProcessType(Map attributes) { // The process type used to be set by the LocalTerminalProcessFactory. However, if some // client code managed to instantiate a LocalTerminalProcess directly (instead of going @@ -184,7 +183,7 @@ public final class LocalTerminalProcess extends RuntimeProcess { // if (attributes == null) { - attributes = new HashMap(1); + attributes = new HashMap(1); } attributes.put(IProcess.ATTR_PROCESS_TYPE, PROCESS_TYPE); return attributes; diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessFactory.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessFactory.java index 63c24c63d1f..7932a779ac2 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessFactory.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessFactory.java @@ -34,7 +34,7 @@ public class LocalTerminalProcessFactory implements IProcessFactory { /** * @see IProcessFactory#newProcess(ILaunch, Process, String, Map) */ - public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes) { + public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes) { return new LocalTerminalProcess(launch, process, label, attributes); } diff --git a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessRegistry.java b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessRegistry.java index a29750a51dc..7f30d43aef1 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessRegistry.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.local/src/org/eclipse/tm/internal/terminal/local/process/LocalTerminalProcessRegistry.java @@ -32,7 +32,7 @@ public class LocalTerminalProcessRegistry implements ILaunchesListener2 { private final static LocalTerminalProcessRegistry INSTANCE = new LocalTerminalProcessRegistry(); - private Map processes; + private Map processes; private LocalTerminalProcessRegistry() { @@ -41,7 +41,7 @@ public class LocalTerminalProcessRegistry implements ILaunchesListener2 { // hash code value if the object changes internally. To be safe in those cases, an // IdentityHashMap is used: // - processes = new IdentityHashMap(); + processes = new IdentityHashMap(); } /** @@ -54,7 +54,7 @@ public class LocalTerminalProcessRegistry implements ILaunchesListener2 { */ public static LocalTerminalProcess getFromLaunch(ILaunch launch) { - return INSTANCE.processes.get(launch); + return (LocalTerminalProcess)INSTANCE.processes.get(launch); } /** diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionRemove.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionRemove.java index a3d6e3659d6..c94f57be614 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionRemove.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionRemove.java @@ -11,8 +11,8 @@ package org.eclipse.tm.internal.terminal.actions; import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager; -import org.eclipse.tm.internal.terminal.view.ImageConsts; import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager.ITerminalViewConnectionListener; +import org.eclipse.tm.internal.terminal.view.ImageConsts; public class TerminalActionRemove extends TerminalAction implements ITerminalViewConnectionListener { diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionSelectionDropDown.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionSelectionDropDown.java index b5af7b6de14..653ad66b090 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionSelectionDropDown.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/actions/TerminalActionSelectionDropDown.java @@ -20,9 +20,9 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Menu; import org.eclipse.tm.internal.terminal.view.ITerminalViewConnection; import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager; +import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager.ITerminalViewConnectionListener; import org.eclipse.tm.internal.terminal.view.ImageConsts; import org.eclipse.tm.internal.terminal.view.TerminalViewPlugin; -import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager.ITerminalViewConnectionListener; /** * Drop down action in the console to select the console to display. diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnection.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnection.java index 640caa46b82..cb7ab54966d 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnection.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnection.java @@ -13,7 +13,7 @@ package org.eclipse.tm.internal.terminal.view; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; /** @@ -47,9 +47,9 @@ public interface ITerminalViewConnection { */ ITerminalViewControl getCtlTerminal(); - void saveState(ISettings store); + void saveState(ISettingsStore store); - void loadState(ISettings store); + void loadState(ISettingsStore store); /** * @return true if the input field is visible diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnectionManager.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnectionManager.java index 2576370c8f6..97a78d8c25c 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnectionManager.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/ITerminalViewConnectionManager.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.view; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; /** @@ -73,11 +73,11 @@ public interface ITerminalViewConnectionManager { void addListener(ITerminalViewConnectionListener listener); void removeListener(ITerminalViewConnectionListener listener); - void saveState(ISettings store); + void saveState(ISettingsStore store); /** * @param store * @param factory used to create new {@link ITerminalViewConnection} */ - void loadState(ISettings store,ITerminalViewConnectionFactory factory); + void loadState(ISettingsStore store,ITerminalViewConnectionFactory factory); } \ No newline at end of file diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingStorePrefixDecorator.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingStorePrefixDecorator.java index 51731bffc53..0d7ccfad4b7 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingStorePrefixDecorator.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingStorePrefixDecorator.java @@ -10,21 +10,26 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.view; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -public class SettingStorePrefixDecorator extends org.eclipse.tm.internal.terminal.provisional.api.Settings { +public class SettingStorePrefixDecorator implements ISettingsStore { private final String fPrefix; - private final ISettings fStore; - SettingStorePrefixDecorator(ISettings store,String prefix) { + private final ISettingsStore fStore; + SettingStorePrefixDecorator(ISettingsStore store,String prefix) { fPrefix=prefix; fStore=store; } - public Object get(String key) { + public String get(String key) { return fStore.get(fPrefix+key); } - public boolean set(String key, Object value) { - return super.set(fPrefix+key,value); + public String get(String key, String defaultValue) { + return fStore.get(fPrefix+key,defaultValue); } + + public void put(String key, String value) { + fStore.put(fPrefix+key,value); + } + } diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingsStore.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingsStore.java index b2cc5fd4a08..f74f4a24b79 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingsStore.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/SettingsStore.java @@ -11,14 +11,15 @@ package org.eclipse.tm.internal.terminal.view; import java.util.Arrays; +import java.util.HashMap; import java.util.Map; import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.ui.IMemento; /** - * A {@link IDialogSettings} based {@link ISettings}. + * A {@link IDialogSettings} based {@link ISettingsStore}. * * Setting Store based on IMemento. IMemento documentations says only alpha numeric * values may be used as keys. Therefore the implementation converts dots (.) into @@ -26,10 +27,10 @@ import org.eclipse.ui.IMemento; * * @author Michael Scharf */ -class SettingsStore extends org.eclipse.tm.internal.terminal.provisional.api.Settings { +class SettingsStore implements ISettingsStore { private static final String KEYS = "_keys_"; //$NON-NLS-1$ - + final private Map fMap=new HashMap(); public SettingsStore(IMemento memento) { if(memento==null) return; @@ -49,27 +50,40 @@ class SettingsStore extends org.eclipse.tm.internal.terminal.provisional.api.Set } if(m!=null) { // cache the value in the map - set(key,m.getString(path[path.length-1])); + fMap.put(key,m.getString(path[path.length-1])); } } } } } - public boolean set(String key, Object value) { + public String get(String key) { + return get(key,null); + } + public String get(String key, String defaultValue) { + String value = (String) fMap.get(key); + if ((value == null) || (value.equals(""))) //$NON-NLS-1$ + return defaultValue; + + return value; + } + + public void put(String key, String value) { if(!key.matches("^[\\w.]+$")) //$NON-NLS-1$ throw new IllegalArgumentException("Key '"+key+"' is not alpha numeric or '.'!"); //$NON-NLS-1$ //$NON-NLS-2$ - return super.set(key, value); + // null values remove the key from the map + if ((value == null) || (value.equals(""))) //$NON-NLS-1$ + fMap.remove(key); + else + fMap.put(key, value); } - /** * Save the state into memento. * * @param memento Memento to save state into. */ public void saveState(IMemento memento) { - Map map = getAll(); - String[] keyNames=(String[]) map.keySet().toArray(new String[map.size()]); + String[] keyNames=(String[]) fMap.keySet().toArray(new String[fMap.size()]); Arrays.sort(keyNames); StringBuffer buffer=new StringBuffer(); for (int i = 0; i < keyNames.length; i++) { @@ -85,7 +99,7 @@ class SettingsStore extends org.eclipse.tm.internal.terminal.provisional.api.Set m=child; } // use the last element in path as key of the child memento - m.putString(path[path.length-1], (String) map.get(key)); + m.putString(path[path.length-1], (String) fMap.get(key)); // construct the string for the keys if(i>0) buffer.append(","); //$NON-NLS-1$ diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalView.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalView.java index d27e50a26a8..247d7fcad1f 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalView.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalView.java @@ -69,9 +69,11 @@ import org.eclipse.tm.internal.terminal.control.actions.TerminalActionCut; import org.eclipse.tm.internal.terminal.control.actions.TerminalActionPaste; import org.eclipse.tm.internal.terminal.control.actions.TerminalActionSelectAll; import org.eclipse.tm.internal.terminal.preferences.ITerminalConstants; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; +import org.eclipse.tm.internal.terminal.provisional.api.LayeredSettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.Logger; +import org.eclipse.tm.internal.terminal.provisional.api.PreferenceSettingStore; import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager.ITerminalViewConnectionFactory; @@ -400,7 +402,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi // sequence. fPageBook=new PageBook(wndParent,SWT.NONE); - ISettings s=new SettingStorePrefixDecorator(fStore,"connectionManager"); //$NON-NLS-1$ + ISettingsStore s=new SettingStorePrefixDecorator(fStore,"connectionManager"); //$NON-NLS-1$ fMultiConnectionManager.loadState(s,new ITerminalViewConnectionFactory() { public ITerminalViewConnection create() { return makeViewConnection(); @@ -485,9 +487,9 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi * @param connectors loads the data from store * @return null or the currently selected connector */ - private ITerminalConnector loadSettings(ISettings store, ITerminalConnector[] connectors) { + private ITerminalConnector loadSettings(ISettingsStore store, ITerminalConnector[] connectors) { ITerminalConnector connector=null; - String connectionType=store.getString(STORE_CONNECTION_TYPE); + String connectionType=store.get(STORE_CONNECTION_TYPE); for (int i = 0; i < connectors.length; i++) { connectors[i].load(getStore(store,connectors[i])); if(connectors[i].getId().equals(connectionType)) @@ -517,11 +519,11 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi * @param store the settings will be saved in this store * @param connector the connector that will be saved. Can be null. */ - private void saveSettings(ISettings store, ITerminalConnector connector) { + private void saveSettings(ISettingsStore store, ITerminalConnector connector) { if(connector!=null) { connector.save(getStore(store, connector)); // the last saved connector becomes the default - store.set(STORE_CONNECTION_TYPE,connector.getId()); + store.put(STORE_CONNECTION_TYPE,connector.getId()); } } @@ -531,11 +533,11 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi } public void saveState(IMemento memento) { super.saveState(memento); - fStore.set(STORE_TITLE,getPartName()); + fStore.put(STORE_TITLE,getPartName()); fMultiConnectionManager.saveState(new SettingStorePrefixDecorator(fStore,"connectionManager")); //$NON-NLS-1$ fStore.saveState(memento); } - private ISettings getStore(ISettings store, ITerminalConnector connector) { + private ISettingsStore getStore(ISettingsStore store, ITerminalConnector connector) { return new SettingStorePrefixDecorator(store,connector.getId()+"."); //$NON-NLS-1$ } @@ -683,10 +685,10 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi */ private void legacyLoadState() { // TODO legacy: load the old title.... - String summary=fStore.getString(STORE_SETTING_SUMMARY); + String summary=fStore.get(STORE_SETTING_SUMMARY); if(summary!=null) { getActiveConnection().setSummary(summary); - fStore.set(STORE_SETTING_SUMMARY,null); + fStore.put(STORE_SETTING_SUMMARY,null); } } /** @@ -697,10 +699,10 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi */ private void legacySetTitle() { // restore the title of this view - String title=fStore.getString(STORE_TITLE); + String title=fStore.get(STORE_TITLE); if(title!=null && title.length()>0) { setViewTitle(title); - fStore.set(STORE_TITLE, null); + fStore.put(STORE_TITLE, null); } } diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnection.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnection.java index e4b1117f042..aa90041f355 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnection.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnection.java @@ -25,7 +25,7 @@ import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.tm.internal.terminal.control.CommandInputFieldWithHistory; import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; @@ -89,17 +89,17 @@ class TerminalViewConnection implements ITerminalViewConnection { public ITerminalViewControl getCtlTerminal() { return fCtlTerminal; } - private ISettings getStore(ISettings store,ITerminalConnector connector) { + private ISettingsStore getStore(ISettingsStore store,ITerminalConnector connector) { return new SettingStorePrefixDecorator(store,connector.getId()+"."); //$NON-NLS-1$ } - public void loadState(ISettings store) { - fPartName=store.getString(STORE_PART_NAME); - fSummary=store.getString(STORE_SUMMARY); - fHistory=store.getString(STORE_COMMAND_INPUT_FIELD_HISTORY); - fEncoding=store.getString(STORE_ENCODING); + public void loadState(ISettingsStore store) { + fPartName=store.get(STORE_PART_NAME); + fSummary=store.get(STORE_SUMMARY); + fHistory=store.get(STORE_COMMAND_INPUT_FIELD_HISTORY); + fEncoding=store.get(STORE_ENCODING); // load the state of the connection types ITerminalConnector[] connectors=fCtlTerminal.getConnectors(); - String connectionType=store.getString(STORE_CONNECTION_TYPE); + String connectionType=store.get(STORE_CONNECTION_TYPE); for (int i = 0; i < connectors.length; i++) { connectors[i].load(getStore(store,connectors[i])); // if this is active connection type @@ -107,26 +107,26 @@ class TerminalViewConnection implements ITerminalViewConnection { fCtlTerminal.setConnector(connectors[i]); } - if("true".equals(store.getString(STORE_HAS_COMMAND_INPUT_FIELD))) //$NON-NLS-1$ + if("true".equals(store.get(STORE_HAS_COMMAND_INPUT_FIELD))) //$NON-NLS-1$ setCommandInputField(true); } - public void saveState(ISettings store) { - store.set(STORE_PART_NAME, fPartName); - store.set(STORE_SUMMARY,fSummary); - store.set(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory); - store.set(STORE_ENCODING, fEncoding); + public void saveState(ISettingsStore store) { + store.put(STORE_PART_NAME, fPartName); + store.put(STORE_SUMMARY,fSummary); + store.put(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory); + store.put(STORE_ENCODING, fEncoding); if(fCommandInputField!=null) - store.set(STORE_COMMAND_INPUT_FIELD_HISTORY, fCommandInputField.getHistory()); + store.put(STORE_COMMAND_INPUT_FIELD_HISTORY, fCommandInputField.getHistory()); else - store.set(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory); - store.set(STORE_HAS_COMMAND_INPUT_FIELD,hasCommandInputField()?"true":"false"); //$NON-NLS-1$//$NON-NLS-2$ + store.put(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory); + store.put(STORE_HAS_COMMAND_INPUT_FIELD,hasCommandInputField()?"true":"false"); //$NON-NLS-1$//$NON-NLS-2$ ITerminalConnector[] connectors=fCtlTerminal.getConnectors(); for (int i = 0; i < connectors.length; i++) { connectors[i].save(getStore(store,connectors[i])); } if(fCtlTerminal.getTerminalConnector()!=null) { - store.set(STORE_CONNECTION_TYPE,fCtlTerminal.getTerminalConnector().getId()); + store.put(STORE_CONNECTION_TYPE,fCtlTerminal.getTerminalConnector().getId()); } } public boolean hasCommandInputField() { diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnectionManager.java b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnectionManager.java index dad081de5f4..88af3056b68 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnectionManager.java +++ b/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/TerminalViewConnectionManager.java @@ -16,7 +16,7 @@ import java.util.List; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public class TerminalViewConnectionManager implements ITerminalViewConnectionManager { private static final String STORE_CONNECTION_PREFIX = "connection"; //$NON-NLS-1$ @@ -108,8 +108,8 @@ public class TerminalViewConnectionManager implements ITerminalViewConnectionMan } } - public void saveState(ISettings store) { - store.set(STORE_SIZE,""+fConnections.size()); //$NON-NLS-1$ + public void saveState(ISettingsStore store) { + store.put(STORE_SIZE,""+fConnections.size()); //$NON-NLS-1$ // save all connections int n=0; for (Iterator iterator = fConnections.iterator(); iterator.hasNext();) { @@ -119,21 +119,21 @@ public class TerminalViewConnectionManager implements ITerminalViewConnectionMan n++; // remember the active connection by its prefix if(connection.equals(fActiveConnection)) - store.set(STORE_ACTIVE_CONNECTION,prefix); + store.put(STORE_ACTIVE_CONNECTION,prefix); connection.saveState(new SettingStorePrefixDecorator(store,prefix)); } } - public void loadState(ISettings store,ITerminalViewConnectionFactory factory) { + public void loadState(ISettingsStore store,ITerminalViewConnectionFactory factory) { int size=0; try { - size=Integer.parseInt(store.getString(STORE_SIZE)); + size=Integer.parseInt(store.get(STORE_SIZE)); } catch(Exception e) { // ignore } if(size>0) { // a slot for the connections - String active=store.getString(STORE_ACTIVE_CONNECTION); + String active=store.get(STORE_ACTIVE_CONNECTION); int n=0; for (int i=0;i - + diff --git a/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs index c2dc3aa2f47..a4b6f7df50e 100644 --- a/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -71,4 +71,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF index 03f058c1d27..3afcf44025b 100644 --- a/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF @@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.resources, org.eclipse.swt, org.eclipse.jface -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Export-Package: org.eclipse.tm.internal.terminal.remote;x-internal:=true, org.eclipse.tm.terminal.remote Bundle-Activator: org.eclipse.tm.internal.terminal.remote.Activator diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java index 56bda029317..f97ec007898 100644 --- a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java +++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java @@ -11,7 +11,7 @@ import java.io.InputStream; import java.io.OutputStream; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; @@ -126,7 +126,7 @@ public class RemoteConnector extends TerminalConnectorImpl { * .api.ISettingsStore) */ @Override - public void load(ISettings store) { + public void load(ISettingsStore store) { fSettings.load(store); } @@ -148,7 +148,7 @@ public class RemoteConnector extends TerminalConnectorImpl { * .api.ISettingsStore) */ @Override - public void save(ISettings store) { + public void save(ISettingsStore store) { fSettings.save(store); } diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java index 53bf5f26d28..e71e9f65eb9 100644 --- a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java +++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java @@ -7,7 +7,7 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.remote; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.terminal.remote.IRemoteSettings; @SuppressWarnings("restriction") @@ -38,17 +38,17 @@ public class RemoteSettings implements IRemoteSettings { /** * Load information into the RemoteSettings object. */ - public void load(ISettings store) { - fRemoteServices = store.getString(REMOTE_SERVICES); - fConnectionName = store.getString(CONNECTION_NAME); + public void load(ISettingsStore store) { + fRemoteServices = store.get(REMOTE_SERVICES); + fConnectionName = store.get(CONNECTION_NAME); } /** * Extract information from the RemoteSettings object. */ - public void save(ISettings store) { - store.getString(REMOTE_SERVICES, fRemoteServices); - store.getString(CONNECTION_NAME, fConnectionName); + public void save(ISettingsStore store) { + store.put(REMOTE_SERVICES, fRemoteServices); + store.put(CONNECTION_NAME, fConnectionName); } public void setConnectionName(String name) { diff --git a/plugins/org.eclipse.tm.terminal.serial/.classpath b/plugins/org.eclipse.tm.terminal.serial/.classpath index ad32c83a788..b978e78e121 100644 --- a/plugins/org.eclipse.tm.terminal.serial/.classpath +++ b/plugins/org.eclipse.tm.terminal.serial/.classpath @@ -1,7 +1,11 @@ - - + + + + + + diff --git a/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs index c2dc3aa2f47..f1f183d2609 100644 --- a/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs @@ -1,21 +1,21 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.autoboxing=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning @@ -71,4 +71,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.3 diff --git a/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF index b27bc126daa..5e8cf83952b 100644 --- a/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF @@ -12,7 +12,7 @@ Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Eclipse-BuddyPolicy: ext Bundle-Vendor: %providerName -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: J2SE-1.4 Bundle-ClassPath: . Bundle-Activator: org.eclipse.tm.internal.terminal.serial.Activator Export-Package: org.eclipse.tm.internal.terminal.serial;x-internal:=true diff --git a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java index f6659aa23ed..5fc3a02902c 100644 --- a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java +++ b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java @@ -11,7 +11,7 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.serial; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public interface ISerialSettings { @@ -23,6 +23,6 @@ public interface ISerialSettings { int getFlowControl(); int getTimeout(); String getSummary(); - void load(ISettings store); - void save(ISettings store); + void load(ISettingsStore store); + void save(ISettingsStore store); } \ No newline at end of file diff --git a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java index c3b87a8c8a7..9d431499080 100644 --- a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java +++ b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java @@ -30,7 +30,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; @@ -221,10 +221,10 @@ public class SerialConnector extends TerminalConnectorImpl { public String getSettingsSummary() { return fSettings.getSummary(); } - public void load(ISettings store) { + public void load(ISettingsStore store) { fSettings.load(store); } - public void save(ISettings store) { + public void save(ISettingsStore store) { fSettings.save(store); } } diff --git a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java index 8be28ba6760..8e2457cfc1f 100644 --- a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java +++ b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java @@ -16,13 +16,13 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.serial; +import gnu.io.CommPortIdentifier; + import java.util.Collections; import java.util.Enumeration; import java.util.List; import java.util.Vector; -import gnu.io.CommPortIdentifier; - public class SerialProperties { protected List fSerialPortTable; protected List fBaudRateTable; diff --git a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java index 6b80f8b3f1b..7980b7afe5d 100644 --- a/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java +++ b/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java @@ -18,7 +18,7 @@ package org.eclipse.tm.internal.terminal.serial; import gnu.io.SerialPort; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public class SerialSettings implements ISerialSettings { protected String fSerialPort; @@ -153,23 +153,23 @@ public class SerialSettings implements ISerialSettings { getFlowControlString(); } - public void load(ISettings store) { - fSerialPort = store.getString("SerialPort", fProperties.getDefaultSerialPort());//$NON-NLS-1$ - fBaudRate = store.getString("BaudRate", fProperties.getDefaultBaudRate());//$NON-NLS-1$ - fDataBits = store.getString("DataBits", fProperties.getDefaultDataBits());//$NON-NLS-1$ - fStopBits = store.getString("StopBits", fProperties.getDefaultStopBits());//$NON-NLS-1$ - fParity = store.getString("Parity", fProperties.getDefaultParity());//$NON-NLS-1$ - fFlowControl = store.getString("FlowControl", fProperties.getDefaultFlowControl());//$NON-NLS-1$ - fTimeout = store.getString("Timeout",fProperties.getDefaultTimeout()); //$NON-NLS-1$ + public void load(ISettingsStore store) { + fSerialPort = store.get("SerialPort", fProperties.getDefaultSerialPort());//$NON-NLS-1$ + fBaudRate = store.get("BaudRate", fProperties.getDefaultBaudRate());//$NON-NLS-1$ + fDataBits = store.get("DataBits", fProperties.getDefaultDataBits());//$NON-NLS-1$ + fStopBits = store.get("StopBits", fProperties.getDefaultStopBits());//$NON-NLS-1$ + fParity = store.get("Parity", fProperties.getDefaultParity());//$NON-NLS-1$ + fFlowControl = store.get("FlowControl", fProperties.getDefaultFlowControl());//$NON-NLS-1$ + fTimeout = store.get("Timeout",fProperties.getDefaultTimeout()); //$NON-NLS-1$ } - public void save(ISettings store) { - store.set("SerialPort", fSerialPort); //$NON-NLS-1$ - store.set("BaudRate", fBaudRate); //$NON-NLS-1$ - store.set("DataBits", fDataBits); //$NON-NLS-1$ - store.set("StopBits", fStopBits); //$NON-NLS-1$ - store.set("Parity", fParity); //$NON-NLS-1$ - store.set("FlowControl", fFlowControl); //$NON-NLS-1$ + public void save(ISettingsStore store) { + store.put("SerialPort", fSerialPort); //$NON-NLS-1$ + store.put("BaudRate", fBaudRate); //$NON-NLS-1$ + store.put("DataBits", fDataBits); //$NON-NLS-1$ + store.put("StopBits", fStopBits); //$NON-NLS-1$ + store.put("Parity", fParity); //$NON-NLS-1$ + store.put("FlowControl", fFlowControl); //$NON-NLS-1$ } public SerialProperties getProperties() { diff --git a/plugins/org.eclipse.tm.terminal.ssh/.classpath b/plugins/org.eclipse.tm.terminal.ssh/.classpath index ad32c83a788..ce73933404a 100644 --- a/plugins/org.eclipse.tm.terminal.ssh/.classpath +++ b/plugins/org.eclipse.tm.terminal.ssh/.classpath @@ -1,7 +1,7 @@ - - + + diff --git a/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs index c2dc3aa2f47..f1f183d2609 100644 --- a/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs @@ -1,21 +1,21 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.autoboxing=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning @@ -71,4 +71,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.3 diff --git a/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF index 4f15d9c50aa..cb4228c2770 100644 --- a/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF @@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.tm.terminal;bundle-version="3.3.0", com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)", org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)" -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: J2SE-1.4 Export-Package: org.eclipse.tm.internal.terminal.ssh;x-internal:=true Bundle-Activator: org.eclipse.tm.internal.terminal.ssh.Activator Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java b/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java index c56faa61feb..4c389be56df 100644 --- a/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java +++ b/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.ssh; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public interface ISshSettings { /** @@ -68,11 +68,11 @@ public interface ISshSettings { * Load connection data from a settings store. * @param store the settings store to access. */ - void load(ISettings store); + void load(ISettingsStore store); /** * Store connection data into a settings store. * @param store the settings store to access. */ - void save(ISettings store); + void save(ISettingsStore store); } diff --git a/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java b/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java index 3530c823572..0ebfb5968e3 100644 --- a/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java +++ b/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java @@ -17,7 +17,7 @@ import java.io.InputStream; import java.io.OutputStream; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; @@ -101,10 +101,10 @@ public class SshConnector extends TerminalConnectorImpl { public String getSettingsSummary() { return fSettings.getSummary(); } - public void load(ISettings store) { + public void load(ISettingsStore store) { fSettings.load(store); } - public void save(ISettings store) { + public void save(ISettingsStore store) { fSettings.save(store); } protected JSch getJsch() { diff --git a/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java b/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java index b94f66ad58b..8a1e21ad7bb 100644 --- a/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java +++ b/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java @@ -14,7 +14,7 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.ssh; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public class SshSettings implements ISshSettings { protected String fHost; @@ -39,28 +39,28 @@ public class SshSettings implements ISshSettings { return settings; } - public void load(ISettings store) { - fHost = store.getString("Host");//$NON-NLS-1$ - fUser = store.getString("User");//$NON-NLS-1$ + public void load(ISettingsStore store) { + fHost = store.get("Host");//$NON-NLS-1$ + fUser = store.get("User");//$NON-NLS-1$ // ISettingsStore providers have to make sure that // the password is not saved in some as plain text // on disk. [bug 313991] - fPassword = store.getString("Password");//$NON-NLS-1$ - fPort = store.getString("Port");//$NON-NLS-1$ - fTimeout = store.getString("Timeout");//$NON-NLS-1$ - fKeepalive = store.getString("Keepalive");//$NON-NLS-1$ + fPassword = store.get("Password");//$NON-NLS-1$ + fPort = store.get("Port");//$NON-NLS-1$ + fTimeout = store.get("Timeout");//$NON-NLS-1$ + fKeepalive = store.get("Keepalive");//$NON-NLS-1$ } - public void save(ISettings store) { - store.set("Host", fHost);//$NON-NLS-1$ - store.set("User", fUser);//$NON-NLS-1$ - store.set("Port", fPort);//$NON-NLS-1$ + public void save(ISettingsStore store) { + store.put("Host", fHost);//$NON-NLS-1$ + store.put("User", fUser);//$NON-NLS-1$ + store.put("Port", fPort);//$NON-NLS-1$ // We do *not* store the password in the settings because // this can cause the password to be stored as plain text // in some settings file - store.set("Timeout", fTimeout);//$NON-NLS-1$ - store.set("Keepalive", fKeepalive);//$NON-NLS-1$ + store.put("Timeout", fTimeout);//$NON-NLS-1$ + store.put("Keepalive", fKeepalive);//$NON-NLS-1$ } diff --git a/plugins/org.eclipse.tm.terminal.telnet/.classpath b/plugins/org.eclipse.tm.terminal.telnet/.classpath index 25d360efcad..37d5094e3a9 100644 --- a/plugins/org.eclipse.tm.terminal.telnet/.classpath +++ b/plugins/org.eclipse.tm.terminal.telnet/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs index c2dc3aa2f47..f1f183d2609 100644 --- a/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs @@ -1,21 +1,21 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.autoboxing=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning @@ -71,4 +71,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.3 diff --git a/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF index ea631367c33..111fa979b3d 100644 --- a/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF @@ -8,5 +8,5 @@ Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.tm.terminal;bundle-version="3.3.0" -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: J2SE-1.4 Export-Package: org.eclipse.tm.internal.terminal.telnet;x-internal:=true diff --git a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java index f255131e6df..c18879d45db 100644 --- a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java +++ b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java @@ -11,13 +11,13 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.telnet; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public interface ITelnetSettings { String getHost(); int getNetworkPort(); int getTimeout(); String getSummary(); - void load(ISettings store); - void save(ISettings store); + void load(ISettingsStore store); + void save(ISettingsStore store); } diff --git a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java index ded0f45c95c..0fde60e53aa 100644 --- a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java +++ b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java @@ -26,7 +26,7 @@ import java.io.OutputStream; import java.net.Socket; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; @@ -151,10 +151,10 @@ public class TelnetConnector extends TerminalConnectorImpl { public String getSettingsSummary() { return fSettings.getSummary(); } - public void load(ISettings store) { + public void load(ISettingsStore store) { fSettings.load(store); } - public void save(ISettings store) { + public void save(ISettingsStore store) { fSettings.save(store); } } diff --git a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java index fc5157dee86..0518b25d6cc 100644 --- a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java +++ b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java @@ -16,7 +16,7 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.telnet; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public class TelnetSettings implements ITelnetSettings { protected String fHost; @@ -51,16 +51,16 @@ public class TelnetSettings implements ITelnetSettings { return getHost() + ":" + getNetworkPortString(); //$NON-NLS-1$ } - public void load(ISettings store) { - fHost = store.getString("Host", fProperties.getDefaultHost());//$NON-NLS-1$ - fNetworkPort = store.getString("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$ - fTimeout = store.getString("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$ + public void load(ISettingsStore store) { + fHost = store.get("Host", fProperties.getDefaultHost());//$NON-NLS-1$ + fNetworkPort = store.get("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$ + fTimeout = store.get("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$ } - public void save(ISettings store) { - store.set("Host", fHost);//$NON-NLS-1$ - store.set("NetworkPort", fNetworkPort);//$NON-NLS-1$ - store.set("Timeout", fTimeout);//$NON-NLS-1$ + public void save(ISettingsStore store) { + store.put("Host", fHost);//$NON-NLS-1$ + store.put("NetworkPort", fNetworkPort);//$NON-NLS-1$ + store.put("Timeout", fTimeout);//$NON-NLS-1$ } public TelnetProperties getProperties() { diff --git a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/terminal/telnet/interfaces/ITelnetSettingConstants.java b/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/terminal/telnet/interfaces/ITelnetSettingConstants.java deleted file mode 100644 index 4397f5d2938..00000000000 --- a/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/terminal/telnet/interfaces/ITelnetSettingConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.telnet.interfaces; - -/** - * Telnet terminal connection settings constants. - */ -public interface ITelnetSettingConstants { - -} diff --git a/plugins/org.eclipse.tm.terminal.test/.classpath b/plugins/org.eclipse.tm.terminal.test/.classpath index ad32c83a788..64c5e31b7a2 100644 --- a/plugins/org.eclipse.tm.terminal.test/.classpath +++ b/plugins/org.eclipse.tm.terminal.test/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs index fcd7b940075..40c9c1aa311 100644 --- a/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -79,4 +79,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF index eabe482ba35..7164d348c6a 100644 --- a/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Require-Bundle: org.junit, org.eclipse.tm.terminal;bundle-version="3.3.0", org.eclipse.core.runtime, org.eclipse.ui -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true, org.eclipse.tm.internal.terminal.emulator;x-internal:=true, org.eclipse.tm.internal.terminal.model;x-internal:=true, diff --git a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java index 40373f8051e..b9c4d3c6a74 100644 --- a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java +++ b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java @@ -22,13 +22,26 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Settings; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; public class TerminalConnectorFactoryTest extends TestCase { + public class SettingsMock implements ISettingsStore { + + public String get(String key) { + return null; + } + + public String get(String key, String defaultValue) { + return null; + } + + public void put(String key, String value) { + } + + } public static class TerminalControlMock implements ITerminalControl { public void setEncoding(String encoding) { @@ -85,8 +98,8 @@ public class TerminalConnectorFactoryTest extends TestCase { public int fWidth; public int fHeight; public ITerminalControl fControl; - public ISettings fSaveStore; - public ISettings fLoadStore; + public ISettingsStore fSaveStore; + public ISettingsStore fLoadStore; public boolean fDisconnect; public boolean isLocalEcho() { @@ -112,7 +125,7 @@ public class TerminalConnectorFactoryTest extends TestCase { return "Summary"; } - public void load(ISettings store) { + public void load(ISettingsStore store) { fLoadStore=store; } @@ -133,7 +146,7 @@ public class TerminalConnectorFactoryTest extends TestCase { }}; } - public void save(ISettings store) { + public void save(ISettingsStore store) { fSaveStore=store; } } @@ -232,7 +245,7 @@ public class TerminalConnectorFactoryTest extends TestCase { public void testLoad() { ConnectorMock mock=new ConnectorMock(); TerminalConnector c = makeTerminalConnector(mock); - ISettings s=new Settings(); + ISettingsStore s=new SettingsMock(); c.load(s); // the load is called after the connect... assertNull(mock.fLoadStore); @@ -243,7 +256,7 @@ public class TerminalConnectorFactoryTest extends TestCase { public void testSave() { ConnectorMock mock=new ConnectorMock(); TerminalConnector c = makeTerminalConnector(mock); - ISettings s=new Settings(); + ISettingsStore s=new SettingsMock(); c.save(s); assertNull(mock.fSaveStore); c.connect(new TerminalControlMock()); diff --git a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java index e7040756db8..10863867a20 100644 --- a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java +++ b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java @@ -15,7 +15,6 @@ package org.eclipse.tm.internal.terminal.connector; import java.io.OutputStream; -import java.util.Map; import junit.framework.TestCase; @@ -23,13 +22,26 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; import org.eclipse.tm.internal.terminal.connector.TerminalConnector.Factory; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Settings; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; public class TerminalConnectorTest extends TestCase { + public class SettingsMock implements ISettingsStore { + + public String get(String key) { + return null; + } + + public String get(String key, String defaultValue) { + return null; + } + + public void put(String key, String value) { + } + + } public static class TerminalControlMock implements ITerminalControl { public void setEncoding(String encoding) { @@ -86,8 +98,8 @@ public class TerminalConnectorTest extends TestCase { public int fWidth; public int fHeight; public ITerminalControl fControl; - public ISettings fSaveStore; - public ISettings fLoadStore; + public ISettingsStore fSaveStore; + public ISettingsStore fLoadStore; public boolean fDisconnect; public boolean isLocalEcho() { @@ -113,7 +125,7 @@ public class TerminalConnectorTest extends TestCase { return "Summary"; } - public void load(ISettings store) { + public void load(ISettingsStore store) { fLoadStore=store; } @@ -135,7 +147,7 @@ public class TerminalConnectorTest extends TestCase { } - public void save(ISettings store) { + public void save(ISettingsStore store) { fSaveStore=store; } } @@ -212,7 +224,7 @@ public class TerminalConnectorTest extends TestCase { public void testLoad() { ConnectorMock mock=new ConnectorMock(); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - ISettings s=new Settings(); + ISettingsStore s=new SettingsMock(); c.load(s); // the load is called after the connect... assertNull(mock.fLoadStore); @@ -223,7 +235,7 @@ public class TerminalConnectorTest extends TestCase { public void testSave() { ConnectorMock mock=new ConnectorMock(); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - ISettings s=new Settings(); + ISettingsStore s=new SettingsMock(); c.save(s); assertNull(mock.fSaveStore); c.connect(new TerminalControlMock()); diff --git a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/SnapshotChangesTest.java b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/SnapshotChangesTest.java index 464f0d71147..c4bf4387e60 100644 --- a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/SnapshotChangesTest.java +++ b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/SnapshotChangesTest.java @@ -10,10 +10,10 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.model; -import org.eclipse.tm.terminal.model.ITerminalTextData; - import junit.framework.TestCase; +import org.eclipse.tm.terminal.model.ITerminalTextData; + public class SnapshotChangesTest extends TestCase { /** * @param change diff --git a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java index bc37435449e..88e9b5a5d13 100644 --- a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java +++ b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java @@ -18,7 +18,7 @@ import java.io.InputStream; import java.io.OutputStream; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; @@ -86,7 +86,7 @@ public class SpeedTestConnector extends TerminalConnectorImpl { //throw new RuntimeException("XXX problems\nSpeedTest\nXXX!"); } - public void load(ISettings store) { + public void load(ISettingsStore store) { fSettings.load(store); } @@ -94,7 +94,7 @@ public class SpeedTestConnector extends TerminalConnectorImpl { return new SpeedTestSettingsPage(fSettings); } - public void save(ISettings store) { + public void save(ISettingsStore store) { fSettings.save(store); } diff --git a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java index 2db9f3fd822..84f94226ce0 100644 --- a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java +++ b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java @@ -11,7 +11,7 @@ package org.eclipse.tm.internal.terminal.speedtest; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; public class SpeedTestSettings { String fInputFile=""; @@ -36,15 +36,15 @@ public class SpeedTestSettings { void setInputFile(String testFile) { fInputFile = testFile; } - public void load(ISettings store) { - fInputFile=store.getString("inputFile"); - fBufferSize=store.getString("bufferSize"); - fThrottle=store.getString("throttle"); + public void load(ISettingsStore store) { + fInputFile=store.get("inputFile"); + fBufferSize=store.get("bufferSize"); + fThrottle=store.get("throttle"); } - public void save(ISettings store) { - store.set("inputFile", fInputFile); - store.set("bufferSize", fBufferSize); - store.set("throttle", fThrottle); + public void save(ISettingsStore store) { + store.put("inputFile", fInputFile); + store.put("bufferSize", fBufferSize); + store.put("throttle", fThrottle); } public String getThrottleString() { return fThrottle; diff --git a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java index 604d8b58bd2..473115c278b 100644 --- a/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java +++ b/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java @@ -17,10 +17,19 @@ package org.eclipse.tm.internal.terminal.test.terminalcanvas; * For a list of all SWT example snippets see * http://www.eclipse.org/swt/snippets/ */ -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Canvas; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.ScrollBar; +import org.eclipse.swt.widgets.Shell; public class Snippet48 { diff --git a/plugins/org.eclipse.tm.terminal/.classpath b/plugins/org.eclipse.tm.terminal/.classpath index 25d360efcad..37d5094e3a9 100644 --- a/plugins/org.eclipse.tm.terminal/.classpath +++ b/plugins/org.eclipse.tm.terminal/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs index 6a5966a2f19..d86e9d88ef7 100644 --- a/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs @@ -7,12 +7,13 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=warning @@ -23,29 +24,42 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning @@ -61,9 +75,9 @@ org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled @@ -71,30 +85,30 @@ org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.4 diff --git a/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 88bb9570e83..00000000000 --- a/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Target Explorer Java STD -formatter_settings_version=12 -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=true -sp_cleanup.remove_unused_imports=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF index 5a60876bd84..b7973c8d0c4 100644 --- a/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF @@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: J2SE-1.4 Bundle-ClassPath: . Export-Package: org.eclipse.tm.internal.terminal.connector;x-friends:="org.eclipse.tm.terminal.test", org.eclipse.tm.internal.terminal.control;x-friends:="org.eclipse.tm.terminal.view", diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java index 3017e1a60d5..8864d69495c 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java @@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.Platform; import org.eclipse.tm.internal.terminal.control.impl.TerminalMessages; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; @@ -93,7 +93,7 @@ public class TerminalConnector implements ITerminalConnector { * The store might be set before the real connector is initialized. * This keeps the value until the connector is created. */ - private ISettings fStore; + private ISettingsStore fStore; /** * Constructor for the terminal connector. * @@ -173,7 +173,7 @@ public class TerminalConnector implements ITerminalConnector { public boolean isLocalEcho() { return getConnectorImpl().isLocalEcho(); } - public void load(ISettings store) { + public void load(ISettingsStore store) { if(fConnector==null) { fStore=store; } else { @@ -183,7 +183,7 @@ public class TerminalConnector implements ITerminalConnector { public ISettingsPage makeSettingsPage() { return getConnectorImpl().makeSettingsPage(); } - public void save(ISettings store) { + public void save(ISettingsStore store) { // no need to save the settings: it cannot have changed // because we are not initialized.... if(fConnector!=null) diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java index b64c6c0d694..40353718f18 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java @@ -37,7 +37,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro /* (non-Javadoc) * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#addListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener) */ - @Override public void addListener(Listener listener) { Assert.isNotNull(listener); listeners.add(listener); @@ -46,7 +45,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro /* (non-Javadoc) * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#removeListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener) */ - @Override public void removeListener(Listener listener) { Assert.isNotNull(listener); listeners.remove(listener); @@ -69,7 +67,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IMessageProvider#getMessage() */ - @Override public final String getMessage() { return message; } @@ -77,7 +74,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType() */ - @Override public final int getMessageType() { return messageType; } diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettings.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettings.java deleted file mode 100644 index 78434716ebc..00000000000 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettings.java +++ /dev/null @@ -1,244 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2011 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * 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: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Uwe Stieber (Wind River) - Extend API to allow storage of non-string settings - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import java.util.Map; - -import org.eclipse.core.runtime.IAdaptable; - -/** - * The settings contains the state of a connection. The content of the settings - * is not the persisted state of the connection. Storing data in the settings - * does not make any assumption about possibly persisting the connection state. - * Connection persistence has to be implemented by the UI container embedding - * the Terminal control. - *

- * EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will - * work or that it will remain the same. Please do not use this API without - * consulting with the Target Management team. - *

- */ -public interface ISettings extends IAdaptable { - - /** - * Set the settings from the given map. Calling this method - * will overwrite all previous set settings. - *

- * Note: The method will have no effect if the given settings are the - * same as the already set settings. - * - * @param settings The map of settings to set. Must not be null. - */ - public void set(Map settings); - - /** - * Adds all settings from the given map. If a setting already exist - * in the settings, than the value of the setting is overwritten. - * - * @param settings The map of settings to add. Must not be null. - */ - public void addAll(Map settings); - - /** - * Stores the setting under the given key using the given value. If the current - * value is equal to the given value, no store operation will be executed. If the - * value is not null and is different from the current value, the new - * value will be written to the settings. If the value is null, the - * key and the currently stored value are removed from the settings. - * - * @param key The key. Must not be null! - * @param value The value. - * - * @return true if the value had been applied to the settings, false otherwise. - */ - public boolean set(String key, Object value); - - /** - * Stores the setting under the given key using the given long value. The given - * long value is transformed to an Long object and stored to the - * settings store via set(java.lang.String, java.lang.Object). - * - * @param key The key. Must not be null! - * @param value The value. - * - * @return true if the value had been applied to the settings, false otherwise. - * - * @see set(java.lang.String, java.lang.Object) - */ - public boolean set(String key, long value); - - /** - * Stores the setting under the given key using the given integer value. The given - * integer value is transformed to an Integer object and stored to the - * settings via set(java.lang.String, java.lang.Object). - * - * @param key The key. Must not be null! - * @param value The value. - * - * @return true if the value had been applied to the settings, false otherwise. - * - * @see set(java.lang.String, java.lang.Object) - */ - public boolean set(String key, int value); - - /** - * Stores the setting under the given key using the given boolean value. The given - * boolean value is transformed to an Boolean object and stored to the - * settings via set(java.lang.String, java.lang.Object). - * - * @param key The key. Must not be null! - * @param value The value. - * - * @return true if the value had been applied to the settings, false otherwise. - * - * @see set(java.lang.String, java.lang.Object) - */ - public boolean set(String key, boolean value); - - /** - * Stores the setting under the given key using the given float value. The given - * float value is transformed to an Float object and stored to the - * settings via set(java.lang.String, java.lang.Object). - * - * @param key The key. Must not be null! - * @param value The value. - * - * @return true if the value had been applied to the settings, false otherwise. - * - * @see set(java.lang.String, java.lang.Object) - */ - public boolean set(String key, float value); - - /** - * Stores the setting under the given key using the given double value. The given - * double value is transformed to an Double object and stored to the - * settings via set(java.lang.String, java.lang.Object). - * - * @param key The key. Must not be null! - * @param value The value. - * - * @return true if the value had been applied to the settings, false otherwise. - * - * @see set(java.lang.String, java.lang.Object) - */ - public boolean set(String key, double value); - - /** - * Return all settings. The result map is read-only. - * - * @return A map containing all settings. - */ - public Map getAll(); - - /** - * Queries the value stored under the given key. If the setting does not exist, - * null is returned. - * - * @param key The key. Must not be null! - * @return The stored value or null. - */ - public Object get(String key); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.String, the value casted to java.lang.String - * is returned. In all other cases, null is returned. - * - * @param key The key. Must not be null! - * @return The stored value casted java.lang.String or null. - */ - public String getString(String key); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.String, the value casted to java.lang.String - * is returned. In all other cases, the given default value is returned. - * - * @param key The key. Must not be null! - * @param defaultValue The default value or null. - * - * @return The stored value casted java.lang.String or the default value. - */ - public String getString(String key, String defaultValue); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.Long, the value converted to an long value is returned. In - * all other cases, -1 is returned. - * - * @param key The key. Must not be null! - * @return The stored value converted to a long value or -1. - */ - public long getLong(String key); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.Integer, the value converted to an integer value is returned. - * In all other cases, -1 is returned. - * - * @param key The key. Must not be null! - * @return The stored value converted to an integer value or -1. - */ - public int getInt(String key); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.Boolean, the value converted to an boolean value is returned. - * In all other cases, false is returned. - * - * @param key The key. Must not be null! - * @return The stored value converted to an boolean value or false. - */ - public boolean getBoolean(String key); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.Float, the value converted to an float value is returned. - * In all other cases, Float.NaN is returned. - * - * @param key The key. Must not be null! - * @return The stored value converted to a float value or Float.NaN. - */ - public float getFloat(String key); - - /** - * Queries the value stored under the given key. If the setting exist and is of type - * java.lang.Double, the value converted to an double value is returned. - * In all other cases, Double.NaN is returned. - * - * @param key The key. Must not be null! - * @return The stored value converted to a double value or Double.NaN. - */ - public double getDouble(String key); - - /** - * Remove all settings. - */ - public void clear(); - - /** - * Returns whether the settings are empty or not. - * - * @return True if the settings are empty, false if not. - */ - public boolean isEmpty(); - - /** - * Returns whether the settings contains the given key. - * - * @param key The key. Must not be null. - * @return True if the settings contains the key, false if not. - */ - public boolean containsKey(String key); -} diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java new file mode 100644 index 00000000000..8822af3df71 --- /dev/null +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2006, 2011 Wind River Systems, Inc. and others. + * All rights reserved. This program and the accompanying materials + * 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: + * Michael Scharf (Wind River) - initial API and implementation + * Martin Oberhuber (Wind River) - fixed copyright headers and beautified + *******************************************************************************/ +package org.eclipse.tm.internal.terminal.provisional.api; + +/** + * A simple interface to a store to persist the state of a connection. + * + * @author Michael Scharf + *

+ * EXPERIMENTAL. This class or interface has been added as + * part of a work in progress. There is no guarantee that this API will + * work or that it will remain the same. Please do not use this API without + * consulting with the Target Management team. + *

+ */ +public interface ISettingsStore { + /** + * @param key alpha numeric key, may contain dots (.) + * @return value + */ + String get(String key); + + /** + * @param key alpha numeric key, may contain dots (.) + * @param defaultValue + * @return the value or the default + */ + String get(String key, String defaultValue); + + /** + * Save a string value + * @param key alpha numeric key, may contain dots (.) + * @param value + */ + void put(String key, String value); +} diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java index 2ee0ca1b581..17932058ef5 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java @@ -124,14 +124,14 @@ public interface ITerminalConnector extends IAdaptable { * @param store a string based data store. Short keys like "foo" can be used to * store the state of the connection. */ - void load(ISettings store); + void load(ISettingsStore store); /** * When the view or dialog containing the terminal is closed, * the state of the connection is saved into the settings store store * @param store */ - void save(ISettings store); + void save(ISettingsStore store); /** * FIXME should not have UI related stuff in ITerminalConnector, since diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/LayeredSettingsStore.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java similarity index 60% rename from deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/LayeredSettingsStore.java rename to plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java index be7ebbfbd5c..8559224eec5 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/LayeredSettingsStore.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java @@ -8,13 +8,10 @@ * Contributors: * Michael Scharf (Wind River) - initial API and implementation *******************************************************************************/ -package org.eclipse.tm.internal.terminal.view; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; -import org.eclipse.tm.internal.terminal.provisional.api.Settings; +package org.eclipse.tm.internal.terminal.provisional.api; /** - * Uses an array of {@link ISettings} to find a value. + * Uses an array of {@link ISettingsStore} to find a value. *

* EXPERIMENTAL. This class or interface has been added as part * of a work in progress. There is no guarantee that this API will work or that @@ -22,16 +19,16 @@ import org.eclipse.tm.internal.terminal.provisional.api.Settings; * the Target Management team. *

*/ -public class LayeredSettingsStore extends Settings { +public class LayeredSettingsStore implements ISettingsStore { - private final ISettings[] fStores; + private final ISettingsStore[] fStores; /** * @param stores the stores used to search the values. - * {@link #set(String, Object)} will put the value in the + * {@link #put(String, String)} will put the value in the * first store in the list. */ - public LayeredSettingsStore(ISettings[] stores) { + public LayeredSettingsStore(ISettingsStore[] stores) { fStores=stores; } /** @@ -39,21 +36,27 @@ public class LayeredSettingsStore extends Settings { * @param s1 first store * @param s2 second store */ - public LayeredSettingsStore(ISettings s1, ISettings s2) { - this(new ISettings[]{s1,s2}); + public LayeredSettingsStore(ISettingsStore s1, ISettingsStore s2) { + this(new ISettingsStore[]{s1,s2}); } - - public Object get(String key) { + public String get(String key) { for (int i = 0; i < fStores.length; i++) { - Object value=fStores[i].get(key); - if (value!=null) + String value=fStores[i].get(key); + if(value!=null) return value; } return null; } - public boolean set(String key, Object value) { - return fStores[0].set(key,value); + public String get(String key, String defaultValue) { + String value=get(key); + if ((value == null) || (value.equals(""))) //$NON-NLS-1$ + return defaultValue; + return value; + } + + public void put(String key, String value) { + fStores[0].put(key,value); } } diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java index e703482bb90..fa6fee91f87 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java @@ -13,12 +13,11 @@ *******************************************************************************/ package org.eclipse.tm.internal.terminal.provisional.api; +import java.io.File; import java.io.FileOutputStream; import java.io.PrintStream; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; @@ -51,14 +50,24 @@ public final class Logger { private static PrintStream logStream; static { - IPath logFile = Platform.getStateLocation(TerminalPlugin.getDefault().getBundle()); - if (logFile != null && logFile.toFile().isDirectory()) { - logFile = logFile.append("tmterminal.log"); //$NON-NLS-1$ + String logFile = null; + //TODO I think this should go into the workspace metadata instead. + File logDirWindows = new File("C:\\eclipselogs"); //$NON-NLS-1$ + File logDirUNIX = new File("/tmp/eclipselogs"); //$NON-NLS-1$ + + if (logDirWindows.isDirectory()) { + logFile = logDirWindows + "\\tmterminal.log"; //$NON-NLS-1$ + } else if (logDirUNIX.isDirectory()) { + logFile = logDirUNIX + "/tmterminal.log"; //$NON-NLS-1$ + } + + if (logFile != null) { try { - logStream = new PrintStream(new FileOutputStream(logFile.toFile(), true)); + logStream = new PrintStream(new FileOutputStream(logFile, true)); } catch (Exception ex) { logStream = System.err; - logStream.println("Exception when opening log file -- logging to stderr!"); //$NON-NLS-1$ + logStream + .println("Exception when opening log file -- logging to stderr!"); //$NON-NLS-1$ ex.printStackTrace(logStream); } } diff --git a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PreferenceSettingStore.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java similarity index 78% rename from deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PreferenceSettingStore.java rename to plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java index 4b25960bc3c..ff0e6f8585a 100644 --- a/deprecated/plugins/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PreferenceSettingStore.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java @@ -8,7 +8,7 @@ * Contributors: * Michael Scharf (Wind River) - initial API and implementation *******************************************************************************/ -package org.eclipse.tm.internal.terminal.view; +package org.eclipse.tm.internal.terminal.provisional.api; import org.eclipse.core.runtime.Preferences; @@ -21,7 +21,7 @@ import org.eclipse.core.runtime.Preferences; * the Target Management team. *

*/ -public class PreferenceSettingStore extends org.eclipse.tm.internal.terminal.provisional.api.Settings { +public class PreferenceSettingStore implements ISettingsStore { private final String fPrefix; private final Preferences fPreferences; @@ -35,16 +35,19 @@ public class PreferenceSettingStore extends org.eclipse.tm.internal.terminal.pro fPreferences=preferences; fPrefix=prefix; } - - public Object get(String key) { + public String get(String key) { return fPreferences.getString(makeKey(key)); } + public String get(String key, String defaultValue) { + String value=get(key); + if ((value == null) || (value.equals(""))) //$NON-NLS-1$ + return defaultValue; - public boolean set(String key, Object value) { - if (value instanceof String) { - fPreferences.setValue(makeKey(key), (String)value); - } - return true; + return value; + } + + public void put(String key, String value) { + fPreferences.setValue(makeKey(key), value); } /** * @param key diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Settings.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Settings.java deleted file mode 100644 index ee3fe04ab94..00000000000 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Settings.java +++ /dev/null @@ -1,359 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials 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: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.PlatformObject; - -/** - * Terminal connection settings implementation. - */ -public class Settings extends PlatformObject implements ISettings { - /** - * A map of settings. The keys are always strings, the value might be any object. - */ - private Map settings = new HashMap(); - - /** - * Constructor. - */ - public Settings() { - super(); - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - boolean equals = super.equals(obj); - if (!equals && obj instanceof Settings) { - return settings.equals(((Settings)obj).settings); - } - return equals; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return settings.hashCode(); - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - final StringBuilder buffer = new StringBuilder(); - - // print the first level of the settings map only - buffer.append("settings={"); //$NON-NLS-1$ - for (String key : settings.keySet()) { - buffer.append(key); - buffer.append("="); //$NON-NLS-1$ - - Object value = settings.get(key); - if (value instanceof Map || value instanceof ISettings) { - buffer.append("{...}"); //$NON-NLS-1$ - } else { - buffer.append(value); - } - - buffer.append(", "); //$NON-NLS-1$ - } - if (buffer.toString().endsWith(", ")) { //$NON-NLS-1$ - buffer.deleteCharAt(buffer.length() - 1); - buffer.deleteCharAt(buffer.length() - 1); - } - buffer.append("}"); //$NON-NLS-1$ - - return buffer.toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getAll() - */ - @Override - public Map getAll() { - return Collections.unmodifiableMap(new HashMap(settings)); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#get(java.lang.String) - */ - @Override - public Object get(String key) { - return settings.get(key); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getBoolean(java.lang.String) - */ - @Override - public final boolean getBoolean(String key) { - Object value = get(key); - if (value instanceof Boolean) { - return ((Boolean)value).booleanValue(); - } - if (value instanceof String) { - String val = ((String)value).trim(); - return "TRUE".equalsIgnoreCase(val) || "1".equals(val) || "Y".equalsIgnoreCase(val) || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - "JA".equalsIgnoreCase(val) || "YES".equalsIgnoreCase(val); //$NON-NLS-1$ //$NON-NLS-2$ - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getLong(java.lang.String) - */ - @Override - public final long getLong(String key) { - Object value = get(key); - try { - if (value instanceof Long) { - return ((Long)value).longValue(); - } - if (value instanceof Number) { - return ((Number)value).longValue(); - } - if (value != null) { - return Long.decode(value.toString()).longValue(); - } - } catch (Exception e) { - /* ignored on purpose */ - } - - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getInt(java.lang.String) - */ - @Override - public final int getInt(String key) { - Object value = get(key); - try { - if (value instanceof Integer) { - return ((Integer)value).intValue(); - } - if (value instanceof Number) { - return ((Number)value).intValue(); - } - if (value != null) { - return Integer.decode(value.toString()).intValue(); - } - } catch (Exception e) { - /* ignored on purpose */ - } - - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getString(java.lang.String) - */ - @Override - public final String getString(String key) { - Object value = get(key); - return value instanceof String ? (String)value : null; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getString(java.lang.String, java.lang.String) - */ - @Override - public String getString(String key, String defaultValue) { - String value = getString(key); - return value != null ? value : defaultValue; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getFloat(java.lang.String) - */ - @Override - public final float getFloat(String key) { - Object value = get(key); - try { - if (value instanceof Float) { - return ((Float)value).floatValue(); - } - if (value instanceof Number) { - return ((Number)value).floatValue(); - } - if (value != null) { - return Float.parseFloat(value.toString()); - } - } catch (Exception e) { - /* ignored on purpose */ - } - - return Float.NaN; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#getDouble(java.lang.String) - */ - @Override - public final double getDouble(String key) { - Object value = get(key); - try { - if (value instanceof Double) { - return ((Double)value).doubleValue(); - } - if (value instanceof Number) { - return ((Number)value).doubleValue(); - } - if (value != null) { - return Double.parseDouble(value.toString()); - } - } catch (Exception e) { - /* ignored on purpose */ - } - - return Double.NaN; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.util.Map) - */ - @Override - public final void set(Map settings) { - Assert.isNotNull(settings); - - // Change the settings only if they have changed really - if (this.settings.equals(settings)) { - return; - } - - // Clear out all old settings - this.settings.clear(); - // Apply everything from the given settings - this.settings.putAll(settings); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#addAll(java.util.Map) - */ - @Override - public final void addAll(Map settings) { - // Apply everything from the given settings - this.settings.putAll(settings); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.lang.String, boolean) - */ - @Override - public final boolean set(String key, boolean value) { - boolean oldValue = getBoolean(key); - if (oldValue != value) { - return set(key, Boolean.valueOf(value)); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.lang.String, long) - */ - @Override - public final boolean set(String key, long value) { - long oldValue = getLong(key); - if (oldValue != value) { - return set(key, Long.valueOf(value)); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.lang.String, int) - */ - @Override - public final boolean set(String key, int value) { - int oldValue = getInt(key); - if (oldValue != value) { - return set(key, Integer.valueOf(value)); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.lang.String, float) - */ - @Override - public final boolean set(String key, float value) { - float oldValue = getFloat(key); - if (oldValue != value) { - return set(key, Float.valueOf(value)); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.lang.String, double) - */ - @Override - public final boolean set(String key, double value) { - double oldValue = getDouble(key); - if (oldValue != value) { - return set(key, Double.valueOf(value)); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#set(java.lang.String, java.lang.Object) - */ - @Override - public boolean set(String key, Object value) { - Assert.isNotNull(key); - - Object oldValue = settings.get(key); - if ((oldValue == null && value != null) || (oldValue != null && !oldValue.equals(value))) { - if (value != null) { - settings.put(key, value); - } else { - settings.remove(key); - } - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#clear() - */ - @Override - public final void clear() { - settings.clear(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#isEmpty() - */ - @Override - public boolean isEmpty() { - return settings.isEmpty(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettings#containsKey(java.lang.String) - */ - @Override - public boolean containsKey(String key) { - Assert.isNotNull(key); - return settings.containsKey(key); - } -} diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java index 5fc2a866a7c..abed5dd6373 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java @@ -14,7 +14,7 @@ package org.eclipse.tm.internal.terminal.provisional.api.provider; import java.io.OutputStream; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettings; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.Logger; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; @@ -130,7 +130,7 @@ public abstract class TerminalConnectorImpl { * @param store a string based data store. Short keys like "foo" can be used * to store the state of the connection. */ - public void load(ISettings store) { + public void load(ISettingsStore store) { // do nothing by default } @@ -143,7 +143,7 @@ public abstract class TerminalConnectorImpl { * * @param store the store for persisting settings. */ - public void save(ISettings store) { + public void save(ISettingsStore store) { // do nothing by default }