mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Terminal: Revert commits 91db4b63c9
and 2c2dbb710b
This commit is contained in:
parent
2c2dbb710b
commit
498a812564
68 changed files with 423 additions and 968 deletions
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
package org.eclipse.tm.internal.terminal.local;
|
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
|
* 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
|
* @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}.
|
* Saves the settings to a specified {@link ISettings}.
|
||||||
|
@ -57,7 +57,7 @@ public interface ILocalTerminalSettings {
|
||||||
*
|
*
|
||||||
* @param store the {@link ISettings} for storing the settings
|
* @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.
|
* Gets the name of the launch configuration that will be started in the terminal.
|
||||||
|
|
|
@ -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.LocalTerminalProcessFactory;
|
||||||
import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcessRegistry;
|
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.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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
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
|
* by the framework in a uniform way. Maybe a configuration mechanism using attributes
|
||||||
* (like, for example, ILaunchConfiguration) might be beneficial here.
|
* (like, for example, ILaunchConfiguration) might be beneficial here.
|
||||||
*/
|
*/
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
|
|
||||||
settings.load(store);
|
settings.load(store);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ implements IDebugEventSetListener {
|
||||||
*
|
*
|
||||||
* @see TerminalConnectorImpl#save(ISettings)
|
* @see TerminalConnectorImpl#save(ISettings)
|
||||||
*/
|
*/
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
|
|
||||||
settings.save(store);
|
settings.save(store);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
package org.eclipse.tm.internal.terminal.local;
|
package org.eclipse.tm.internal.terminal.local;
|
||||||
|
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
|
||||||
import org.eclipse.debug.core.IStreamListener;
|
import org.eclipse.debug.core.IStreamListener;
|
||||||
import org.eclipse.debug.core.model.IStreamMonitor;
|
import org.eclipse.debug.core.model.IStreamMonitor;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
|
import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.tm.internal.terminal.local;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.debug.core.model.IProcess;
|
import org.eclipse.debug.core.model.IProcess;
|
||||||
import org.eclipse.debug.core.model.IStreamsProxy;
|
import org.eclipse.debug.core.model.IStreamsProxy;
|
||||||
import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcess;
|
import org.eclipse.tm.internal.terminal.local.process.LocalTerminalProcess;
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
package org.eclipse.tm.internal.terminal.local;
|
package org.eclipse.tm.internal.terminal.local;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
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;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,14 +39,14 @@ public class LocalTerminalSettings implements ILocalTerminalSettings {
|
||||||
* @param store the {@link ISettings}
|
* @param store the {@link ISettings}
|
||||||
* @see ILocalTerminalSettings#load(ISettings)
|
* @see ILocalTerminalSettings#load(ISettings)
|
||||||
*/
|
*/
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
|
|
||||||
Field[] declaredField = getClass().getDeclaredFields();
|
Field[] declaredField = getClass().getDeclaredFields();
|
||||||
int numberOfFields = declaredField.length;
|
int numberOfFields = declaredField.length;
|
||||||
for (int index = 0; index < numberOfFields; index++) {
|
for (int index = 0; index < numberOfFields; index++) {
|
||||||
|
|
||||||
Field field = declaredField[index];
|
Field field = declaredField[index];
|
||||||
Class<?> type = field.getType();
|
Class type = field.getType();
|
||||||
Object value = store.get(field.getName());
|
Object value = store.get(field.getName());
|
||||||
if (type.equals(boolean.class)) {
|
if (type.equals(boolean.class)) {
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ public class LocalTerminalSettings implements ILocalTerminalSettings {
|
||||||
*
|
*
|
||||||
* @see ILocalTerminalSettings#save(ISettings)
|
* @see ILocalTerminalSettings#save(ISettings)
|
||||||
*/
|
*/
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
|
|
||||||
Field[] declaredField = getClass().getDeclaredFields();
|
Field[] declaredField = getClass().getDeclaredFields();
|
||||||
int numberOfFields = declaredField.length;
|
int numberOfFields = declaredField.length;
|
||||||
|
@ -81,7 +82,7 @@ public class LocalTerminalSettings implements ILocalTerminalSettings {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
store.set(field.getName(), String.valueOf(field.get(this)));
|
store.put(field.getName(), String.valueOf(field.get(this)));
|
||||||
}
|
}
|
||||||
catch (IllegalAccessException illegalAccess) {
|
catch (IllegalAccessException illegalAccess) {
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,6 @@ public class LocalTerminalLaunchDelegate extends LaunchConfigurationDelegate {
|
||||||
* @param launch the {@link ILaunch} object
|
* @param launch the {@link ILaunch} object
|
||||||
* @exception CoreException if launching fails
|
* @exception CoreException if launching fails
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch,
|
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch,
|
||||||
IProgressMonitor progressMonitor) throws CoreException {
|
IProgressMonitor progressMonitor) throws CoreException {
|
||||||
|
|
||||||
|
@ -181,7 +180,7 @@ public class LocalTerminalLaunchDelegate extends LaunchConfigurationDelegate {
|
||||||
|
|
||||||
// Use program name as "process type" attribute:
|
// Use program name as "process type" attribute:
|
||||||
//
|
//
|
||||||
Map<String, String> processAttributes = new HashMap<String, String>();
|
Map processAttributes = new HashMap();
|
||||||
String programName = location.lastSegment();
|
String programName = location.lastSegment();
|
||||||
String extension = location.getFileExtension();
|
String extension = location.getFileExtension();
|
||||||
if (extension != null) {
|
if (extension != null) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class LocalTerminalLaunchUtilities {
|
||||||
private final static String STRING = null;
|
private final static String STRING = null;
|
||||||
private final static String TERM = "TERM"; //$NON-NLS-1$
|
private final static String TERM = "TERM"; //$NON-NLS-1$
|
||||||
private final static String ANSI = "ansi"; //$NON-NLS-1$
|
private final static String ANSI = "ansi"; //$NON-NLS-1$
|
||||||
private final static Map<String, String> 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:
|
// 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 = terminalLaunchName.format(new Object[] {name});
|
||||||
name = manager.generateLaunchConfigurationName(name);
|
name = manager.generateLaunchConfigurationName(name);
|
||||||
workingCopy = LocalTerminalUtilities.TERMINAL_LAUNCH_TYPE.newInstance(null, name);
|
workingCopy = LocalTerminalUtilities.TERMINAL_LAUNCH_TYPE.newInstance(null, name);
|
||||||
workingCopy.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, new HashMap<String, String>(TERM_ANSI));
|
workingCopy.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, new HashMap(TERM_ANSI));
|
||||||
workingCopy.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
|
workingCopy.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
|
||||||
workingCopy.setAttribute(ATTR_LOCATION, defaultShell);
|
workingCopy.setAttribute(ATTR_LOCATION, defaultShell);
|
||||||
workingCopy.setAttribute(ATTR_WORKING_DIRECTORY, userHome);
|
workingCopy.setAttribute(ATTR_WORKING_DIRECTORY, userHome);
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.tm.internal.terminal.local.launch;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.debug.core.ILaunch;
|
import org.eclipse.debug.core.ILaunch;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
|
@ -81,7 +82,7 @@ public class LocalTerminalStillRunningListener implements IWorkbenchListener {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
List<ILaunch> notTerminated = new ArrayList<ILaunch>();
|
List notTerminated = new ArrayList();
|
||||||
ILaunch launches[] = LocalTerminalUtilities.LAUNCH_MANAGER.getLaunches();
|
ILaunch launches[] = LocalTerminalUtilities.LAUNCH_MANAGER.getLaunches();
|
||||||
ILaunchConfigurationType configurationType;
|
ILaunchConfigurationType configurationType;
|
||||||
ILaunchConfiguration configuration;
|
ILaunchConfiguration configuration;
|
||||||
|
@ -109,7 +110,7 @@ public class LocalTerminalStillRunningListener implements IWorkbenchListener {
|
||||||
if (!notTerminated.isEmpty()) {
|
if (!notTerminated.isEmpty()) {
|
||||||
|
|
||||||
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
|
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 LocalTerminalStillRunningDialog.openDialog(window.getShell(), launch);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -70,7 +70,6 @@ import org.eclipse.debug.core.model.RuntimeProcess;
|
||||||
* @author Mirko Raner
|
* @author Mirko Raner
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
public final class LocalTerminalProcess extends RuntimeProcess {
|
public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +89,7 @@ public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
* @param name the process name
|
* @param name the process name
|
||||||
* @param attributes additional attributes of the process
|
* @param attributes additional attributes of the process
|
||||||
*/
|
*/
|
||||||
protected LocalTerminalProcess(ILaunch launch, Process process, String name, Map<String, String> attributes) {
|
protected LocalTerminalProcess(ILaunch launch, Process process, String name, Map attributes) {
|
||||||
|
|
||||||
super(launch, process, name, setProcessType(attributes));
|
super(launch, process, name, setProcessType(attributes));
|
||||||
enableStreamsProxy = true;
|
enableStreamsProxy = true;
|
||||||
|
@ -174,7 +173,7 @@ public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
|
|
||||||
//------------------------------------- PRIVATE SECTION --------------------------------------//
|
//------------------------------------- PRIVATE SECTION --------------------------------------//
|
||||||
|
|
||||||
private static Map<String, String> setProcessType(Map<String, String> attributes) {
|
private static Map setProcessType(Map attributes) {
|
||||||
|
|
||||||
// The process type used to be set by the LocalTerminalProcessFactory. However, if some
|
// The process type used to be set by the LocalTerminalProcessFactory. However, if some
|
||||||
// client code managed to instantiate a LocalTerminalProcess directly (instead of going
|
// client code managed to instantiate a LocalTerminalProcess directly (instead of going
|
||||||
|
@ -184,7 +183,7 @@ public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
//
|
//
|
||||||
if (attributes == null) {
|
if (attributes == null) {
|
||||||
|
|
||||||
attributes = new HashMap<String, String>(1);
|
attributes = new HashMap(1);
|
||||||
}
|
}
|
||||||
attributes.put(IProcess.ATTR_PROCESS_TYPE, PROCESS_TYPE);
|
attributes.put(IProcess.ATTR_PROCESS_TYPE, PROCESS_TYPE);
|
||||||
return attributes;
|
return attributes;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class LocalTerminalProcessFactory implements IProcessFactory {
|
||||||
/**
|
/**
|
||||||
* @see IProcessFactory#newProcess(ILaunch, Process, String, Map)
|
* @see IProcessFactory#newProcess(ILaunch, Process, String, Map)
|
||||||
*/
|
*/
|
||||||
public IProcess newProcess(ILaunch launch, Process process, String label, Map<String, String> attributes) {
|
public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes) {
|
||||||
|
|
||||||
return new LocalTerminalProcess(launch, process, label, attributes);
|
return new LocalTerminalProcess(launch, process, label, attributes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class LocalTerminalProcessRegistry implements ILaunchesListener2 {
|
||||||
|
|
||||||
private final static LocalTerminalProcessRegistry INSTANCE = new LocalTerminalProcessRegistry();
|
private final static LocalTerminalProcessRegistry INSTANCE = new LocalTerminalProcessRegistry();
|
||||||
|
|
||||||
private Map<ILaunch, LocalTerminalProcess> processes;
|
private Map processes;
|
||||||
|
|
||||||
private LocalTerminalProcessRegistry() {
|
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
|
// hash code value if the object changes internally. To be safe in those cases, an
|
||||||
// IdentityHashMap is used:
|
// IdentityHashMap is used:
|
||||||
//
|
//
|
||||||
processes = new IdentityHashMap<ILaunch, LocalTerminalProcess>();
|
processes = new IdentityHashMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +54,7 @@ public class LocalTerminalProcessRegistry implements ILaunchesListener2 {
|
||||||
*/
|
*/
|
||||||
public static LocalTerminalProcess getFromLaunch(ILaunch launch) {
|
public static LocalTerminalProcess getFromLaunch(ILaunch launch) {
|
||||||
|
|
||||||
return INSTANCE.processes.get(launch);
|
return (LocalTerminalProcess)INSTANCE.processes.get(launch);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
package org.eclipse.tm.internal.terminal.actions;
|
package org.eclipse.tm.internal.terminal.actions;
|
||||||
|
|
||||||
import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager;
|
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.ITerminalViewConnectionManager.ITerminalViewConnectionListener;
|
||||||
|
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||||
|
|
||||||
public class TerminalActionRemove extends TerminalAction implements ITerminalViewConnectionListener
|
public class TerminalActionRemove extends TerminalAction implements ITerminalViewConnectionListener
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,9 +20,9 @@ import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.tm.internal.terminal.view.ITerminalViewConnection;
|
import org.eclipse.tm.internal.terminal.view.ITerminalViewConnection;
|
||||||
import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager;
|
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.ImageConsts;
|
||||||
import org.eclipse.tm.internal.terminal.view.TerminalViewPlugin;
|
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.
|
* Drop down action in the console to select the console to display.
|
||||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.tm.internal.terminal.control.ITerminalViewControl;
|
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;
|
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,9 +47,9 @@ public interface ITerminalViewConnection {
|
||||||
*/
|
*/
|
||||||
ITerminalViewControl getCtlTerminal();
|
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
|
* @return true if the input field is visible
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
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 addListener(ITerminalViewConnectionListener listener);
|
||||||
void removeListener(ITerminalViewConnectionListener listener);
|
void removeListener(ITerminalViewConnectionListener listener);
|
||||||
|
|
||||||
void saveState(ISettings store);
|
void saveState(ISettingsStore store);
|
||||||
/**
|
/**
|
||||||
* @param store
|
* @param store
|
||||||
* @param factory used to create new {@link ITerminalViewConnection}
|
* @param factory used to create new {@link ITerminalViewConnection}
|
||||||
*/
|
*/
|
||||||
void loadState(ISettings store,ITerminalViewConnectionFactory factory);
|
void loadState(ISettingsStore store,ITerminalViewConnectionFactory factory);
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,21 +10,26 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
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 String fPrefix;
|
||||||
private final ISettings fStore;
|
private final ISettingsStore fStore;
|
||||||
SettingStorePrefixDecorator(ISettings store,String prefix) {
|
SettingStorePrefixDecorator(ISettingsStore store,String prefix) {
|
||||||
fPrefix=prefix;
|
fPrefix=prefix;
|
||||||
fStore=store;
|
fStore=store;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String key) {
|
public String get(String key) {
|
||||||
return fStore.get(fPrefix+key);
|
return fStore.get(fPrefix+key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean set(String key, Object value) {
|
public String get(String key, String defaultValue) {
|
||||||
return super.set(fPrefix+key,value);
|
return fStore.get(fPrefix+key,defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void put(String key, String value) {
|
||||||
|
fStore.put(fPrefix+key,value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,15 @@
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.jface.dialogs.IDialogSettings;
|
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;
|
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
|
* Setting Store based on IMemento. IMemento documentations says only alpha numeric
|
||||||
* values may be used as keys. Therefore the implementation converts dots (.) into
|
* values may be used as keys. Therefore the implementation converts dots (.) into
|
||||||
|
@ -26,10 +27,10 @@ import org.eclipse.ui.IMemento;
|
||||||
*
|
*
|
||||||
* @author Michael Scharf
|
* @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$
|
private static final String KEYS = "_keys_"; //$NON-NLS-1$
|
||||||
|
final private Map fMap=new HashMap();
|
||||||
public SettingsStore(IMemento memento) {
|
public SettingsStore(IMemento memento) {
|
||||||
if(memento==null)
|
if(memento==null)
|
||||||
return;
|
return;
|
||||||
|
@ -49,27 +50,40 @@ class SettingsStore extends org.eclipse.tm.internal.terminal.provisional.api.Set
|
||||||
}
|
}
|
||||||
if(m!=null) {
|
if(m!=null) {
|
||||||
// cache the value in the map
|
// 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$
|
if(!key.matches("^[\\w.]+$")) //$NON-NLS-1$
|
||||||
throw new IllegalArgumentException("Key '"+key+"' is not alpha numeric or '.'!"); //$NON-NLS-1$ //$NON-NLS-2$
|
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.
|
* Save the state into memento.
|
||||||
*
|
*
|
||||||
* @param memento Memento to save state into.
|
* @param memento Memento to save state into.
|
||||||
*/
|
*/
|
||||||
public void saveState(IMemento memento) {
|
public void saveState(IMemento memento) {
|
||||||
Map map = getAll();
|
String[] keyNames=(String[]) fMap.keySet().toArray(new String[fMap.size()]);
|
||||||
String[] keyNames=(String[]) map.keySet().toArray(new String[map.size()]);
|
|
||||||
Arrays.sort(keyNames);
|
Arrays.sort(keyNames);
|
||||||
StringBuffer buffer=new StringBuffer();
|
StringBuffer buffer=new StringBuffer();
|
||||||
for (int i = 0; i < keyNames.length; i++) {
|
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;
|
m=child;
|
||||||
}
|
}
|
||||||
// use the last element in path as key of the child memento
|
// 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
|
// construct the string for the keys
|
||||||
if(i>0)
|
if(i>0)
|
||||||
buffer.append(","); //$NON-NLS-1$
|
buffer.append(","); //$NON-NLS-1$
|
||||||
|
|
|
@ -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.TerminalActionPaste;
|
||||||
import org.eclipse.tm.internal.terminal.control.actions.TerminalActionSelectAll;
|
import org.eclipse.tm.internal.terminal.control.actions.TerminalActionSelectAll;
|
||||||
import org.eclipse.tm.internal.terminal.preferences.ITerminalConstants;
|
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.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.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.TerminalConnectorExtension;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||||
import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager.ITerminalViewConnectionFactory;
|
import org.eclipse.tm.internal.terminal.view.ITerminalViewConnectionManager.ITerminalViewConnectionFactory;
|
||||||
|
@ -400,7 +402,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
// sequence.
|
// sequence.
|
||||||
|
|
||||||
fPageBook=new PageBook(wndParent,SWT.NONE);
|
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() {
|
fMultiConnectionManager.loadState(s,new ITerminalViewConnectionFactory() {
|
||||||
public ITerminalViewConnection create() {
|
public ITerminalViewConnection create() {
|
||||||
return makeViewConnection();
|
return makeViewConnection();
|
||||||
|
@ -485,9 +487,9 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
* @param connectors loads the data from store
|
* @param connectors loads the data from store
|
||||||
* @return null or the currently selected connector
|
* @return null or the currently selected connector
|
||||||
*/
|
*/
|
||||||
private ITerminalConnector loadSettings(ISettings store, ITerminalConnector[] connectors) {
|
private ITerminalConnector loadSettings(ISettingsStore store, ITerminalConnector[] connectors) {
|
||||||
ITerminalConnector connector=null;
|
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++) {
|
for (int i = 0; i < connectors.length; i++) {
|
||||||
connectors[i].load(getStore(store,connectors[i]));
|
connectors[i].load(getStore(store,connectors[i]));
|
||||||
if(connectors[i].getId().equals(connectionType))
|
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 store the settings will be saved in this store
|
||||||
* @param connector the connector that will be saved. Can be null.
|
* @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) {
|
if(connector!=null) {
|
||||||
connector.save(getStore(store, connector));
|
connector.save(getStore(store, connector));
|
||||||
// the last saved connector becomes the default
|
// 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) {
|
public void saveState(IMemento memento) {
|
||||||
super.saveState(memento);
|
super.saveState(memento);
|
||||||
fStore.set(STORE_TITLE,getPartName());
|
fStore.put(STORE_TITLE,getPartName());
|
||||||
fMultiConnectionManager.saveState(new SettingStorePrefixDecorator(fStore,"connectionManager")); //$NON-NLS-1$
|
fMultiConnectionManager.saveState(new SettingStorePrefixDecorator(fStore,"connectionManager")); //$NON-NLS-1$
|
||||||
fStore.saveState(memento);
|
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$
|
return new SettingStorePrefixDecorator(store,connector.getId()+"."); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,10 +685,10 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
*/
|
*/
|
||||||
private void legacyLoadState() {
|
private void legacyLoadState() {
|
||||||
// TODO legacy: load the old title....
|
// TODO legacy: load the old title....
|
||||||
String summary=fStore.getString(STORE_SETTING_SUMMARY);
|
String summary=fStore.get(STORE_SETTING_SUMMARY);
|
||||||
if(summary!=null) {
|
if(summary!=null) {
|
||||||
getActiveConnection().setSummary(summary);
|
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() {
|
private void legacySetTitle() {
|
||||||
// restore the title of this view
|
// restore the title of this view
|
||||||
String title=fStore.getString(STORE_TITLE);
|
String title=fStore.get(STORE_TITLE);
|
||||||
if(title!=null && title.length()>0) {
|
if(title!=null && title.length()>0) {
|
||||||
setViewTitle(title);
|
setViewTitle(title);
|
||||||
fStore.set(STORE_TITLE, null);
|
fStore.put(STORE_TITLE, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.eclipse.swt.events.MouseAdapter;
|
||||||
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
import org.eclipse.tm.internal.terminal.control.CommandInputFieldWithHistory;
|
import org.eclipse.tm.internal.terminal.control.CommandInputFieldWithHistory;
|
||||||
import org.eclipse.tm.internal.terminal.control.ITerminalViewControl;
|
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.ITerminalConnector;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||||
|
@ -89,17 +89,17 @@ class TerminalViewConnection implements ITerminalViewConnection {
|
||||||
public ITerminalViewControl getCtlTerminal() {
|
public ITerminalViewControl getCtlTerminal() {
|
||||||
return fCtlTerminal;
|
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$
|
return new SettingStorePrefixDecorator(store,connector.getId()+"."); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
public void loadState(ISettings store) {
|
public void loadState(ISettingsStore store) {
|
||||||
fPartName=store.getString(STORE_PART_NAME);
|
fPartName=store.get(STORE_PART_NAME);
|
||||||
fSummary=store.getString(STORE_SUMMARY);
|
fSummary=store.get(STORE_SUMMARY);
|
||||||
fHistory=store.getString(STORE_COMMAND_INPUT_FIELD_HISTORY);
|
fHistory=store.get(STORE_COMMAND_INPUT_FIELD_HISTORY);
|
||||||
fEncoding=store.getString(STORE_ENCODING);
|
fEncoding=store.get(STORE_ENCODING);
|
||||||
// load the state of the connection types
|
// load the state of the connection types
|
||||||
ITerminalConnector[] connectors=fCtlTerminal.getConnectors();
|
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++) {
|
for (int i = 0; i < connectors.length; i++) {
|
||||||
connectors[i].load(getStore(store,connectors[i]));
|
connectors[i].load(getStore(store,connectors[i]));
|
||||||
// if this is active connection type
|
// if this is active connection type
|
||||||
|
@ -107,26 +107,26 @@ class TerminalViewConnection implements ITerminalViewConnection {
|
||||||
fCtlTerminal.setConnector(connectors[i]);
|
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);
|
setCommandInputField(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveState(ISettings store) {
|
public void saveState(ISettingsStore store) {
|
||||||
store.set(STORE_PART_NAME, fPartName);
|
store.put(STORE_PART_NAME, fPartName);
|
||||||
store.set(STORE_SUMMARY,fSummary);
|
store.put(STORE_SUMMARY,fSummary);
|
||||||
store.set(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory);
|
store.put(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory);
|
||||||
store.set(STORE_ENCODING, fEncoding);
|
store.put(STORE_ENCODING, fEncoding);
|
||||||
if(fCommandInputField!=null)
|
if(fCommandInputField!=null)
|
||||||
store.set(STORE_COMMAND_INPUT_FIELD_HISTORY, fCommandInputField.getHistory());
|
store.put(STORE_COMMAND_INPUT_FIELD_HISTORY, fCommandInputField.getHistory());
|
||||||
else
|
else
|
||||||
store.set(STORE_COMMAND_INPUT_FIELD_HISTORY, fHistory);
|
store.put(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_HAS_COMMAND_INPUT_FIELD,hasCommandInputField()?"true":"false"); //$NON-NLS-1$//$NON-NLS-2$
|
||||||
ITerminalConnector[] connectors=fCtlTerminal.getConnectors();
|
ITerminalConnector[] connectors=fCtlTerminal.getConnectors();
|
||||||
for (int i = 0; i < connectors.length; i++) {
|
for (int i = 0; i < connectors.length; i++) {
|
||||||
connectors[i].save(getStore(store,connectors[i]));
|
connectors[i].save(getStore(store,connectors[i]));
|
||||||
}
|
}
|
||||||
if(fCtlTerminal.getTerminalConnector()!=null) {
|
if(fCtlTerminal.getTerminalConnector()!=null) {
|
||||||
store.set(STORE_CONNECTION_TYPE,fCtlTerminal.getTerminalConnector().getId());
|
store.put(STORE_CONNECTION_TYPE,fCtlTerminal.getTerminalConnector().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean hasCommandInputField() {
|
public boolean hasCommandInputField() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
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 {
|
public class TerminalViewConnectionManager implements ITerminalViewConnectionManager {
|
||||||
private static final String STORE_CONNECTION_PREFIX = "connection"; //$NON-NLS-1$
|
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) {
|
public void saveState(ISettingsStore store) {
|
||||||
store.set(STORE_SIZE,""+fConnections.size()); //$NON-NLS-1$
|
store.put(STORE_SIZE,""+fConnections.size()); //$NON-NLS-1$
|
||||||
// save all connections
|
// save all connections
|
||||||
int n=0;
|
int n=0;
|
||||||
for (Iterator iterator = fConnections.iterator(); iterator.hasNext();) {
|
for (Iterator iterator = fConnections.iterator(); iterator.hasNext();) {
|
||||||
|
@ -119,21 +119,21 @@ public class TerminalViewConnectionManager implements ITerminalViewConnectionMan
|
||||||
n++;
|
n++;
|
||||||
// remember the active connection by its prefix
|
// remember the active connection by its prefix
|
||||||
if(connection.equals(fActiveConnection))
|
if(connection.equals(fActiveConnection))
|
||||||
store.set(STORE_ACTIVE_CONNECTION,prefix);
|
store.put(STORE_ACTIVE_CONNECTION,prefix);
|
||||||
connection.saveState(new SettingStorePrefixDecorator(store,prefix));
|
connection.saveState(new SettingStorePrefixDecorator(store,prefix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadState(ISettings store,ITerminalViewConnectionFactory factory) {
|
public void loadState(ISettingsStore store,ITerminalViewConnectionFactory factory) {
|
||||||
int size=0;
|
int size=0;
|
||||||
try {
|
try {
|
||||||
size=Integer.parseInt(store.getString(STORE_SIZE));
|
size=Integer.parseInt(store.get(STORE_SIZE));
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
if(size>0) {
|
if(size>0) {
|
||||||
// a slot for the connections
|
// a slot for the connections
|
||||||
String active=store.getString(STORE_ACTIVE_CONNECTION);
|
String active=store.get(STORE_ACTIVE_CONNECTION);
|
||||||
int n=0;
|
int n=0;
|
||||||
for (int i=0;i<size;i++) {
|
for (int i=0;i<size;i++) {
|
||||||
// the name under which we stored the connection
|
// the name under which we stored the connection
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
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.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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=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.unusedParameterWhenOverridingConcrete=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=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
|
||||||
|
|
|
@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.core.resources,
|
org.eclipse.core.resources,
|
||||||
org.eclipse.swt,
|
org.eclipse.swt,
|
||||||
org.eclipse.jface
|
org.eclipse.jface
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||||
Export-Package: org.eclipse.tm.internal.terminal.remote;x-internal:=true,
|
Export-Package: org.eclipse.tm.internal.terminal.remote;x-internal:=true,
|
||||||
org.eclipse.tm.terminal.remote
|
org.eclipse.tm.terminal.remote
|
||||||
Bundle-Activator: org.eclipse.tm.internal.terminal.remote.Activator
|
Bundle-Activator: org.eclipse.tm.internal.terminal.remote.Activator
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
||||||
|
@ -126,7 +126,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
|
||||||
* .api.ISettingsStore)
|
* .api.ISettingsStore)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fSettings.load(store);
|
fSettings.load(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
|
||||||
* .api.ISettingsStore)
|
* .api.ISettingsStore)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSettings.save(store);
|
fSettings.save(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.remote;
|
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;
|
import org.eclipse.tm.terminal.remote.IRemoteSettings;
|
||||||
|
|
||||||
@SuppressWarnings("restriction")
|
@SuppressWarnings("restriction")
|
||||||
|
@ -38,17 +38,17 @@ public class RemoteSettings implements IRemoteSettings {
|
||||||
/**
|
/**
|
||||||
* Load information into the RemoteSettings object.
|
* Load information into the RemoteSettings object.
|
||||||
*/
|
*/
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fRemoteServices = store.getString(REMOTE_SERVICES);
|
fRemoteServices = store.get(REMOTE_SERVICES);
|
||||||
fConnectionName = store.getString(CONNECTION_NAME);
|
fConnectionName = store.get(CONNECTION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract information from the RemoteSettings object.
|
* Extract information from the RemoteSettings object.
|
||||||
*/
|
*/
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
store.getString(REMOTE_SERVICES, fRemoteServices);
|
store.put(REMOTE_SERVICES, fRemoteServices);
|
||||||
store.getString(CONNECTION_NAME, fConnectionName);
|
store.put(CONNECTION_NAME, fConnectionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConnectionName(String name) {
|
public void setConnectionName(String name) {
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
|
||||||
|
<accessrules>
|
||||||
|
<accessrule kind="accessible" pattern="gnu/io/**"/>
|
||||||
|
</accessrules>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
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.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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
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.autoboxing=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
|
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=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.fallthroughCase=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=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.unusedParameterWhenOverridingConcrete=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=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
|
||||||
|
|
|
@ -12,7 +12,7 @@ Bundle-ActivationPolicy: lazy
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
Eclipse-BuddyPolicy: ext
|
Eclipse-BuddyPolicy: ext
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||||
Bundle-ClassPath: .
|
Bundle-ClassPath: .
|
||||||
Bundle-Activator: org.eclipse.tm.internal.terminal.serial.Activator
|
Bundle-Activator: org.eclipse.tm.internal.terminal.serial.Activator
|
||||||
Export-Package: org.eclipse.tm.internal.terminal.serial;x-internal:=true
|
Export-Package: org.eclipse.tm.internal.terminal.serial;x-internal:=true
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.serial;
|
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 {
|
public interface ISerialSettings {
|
||||||
|
|
||||||
|
@ -23,6 +23,6 @@ public interface ISerialSettings {
|
||||||
int getFlowControl();
|
int getFlowControl();
|
||||||
int getTimeout();
|
int getTimeout();
|
||||||
String getSummary();
|
String getSummary();
|
||||||
void load(ISettings store);
|
void load(ISettingsStore store);
|
||||||
void save(ISettings store);
|
void save(ISettingsStore store);
|
||||||
}
|
}
|
|
@ -30,7 +30,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||||
|
@ -221,10 +221,10 @@ public class SerialConnector extends TerminalConnectorImpl {
|
||||||
public String getSettingsSummary() {
|
public String getSettingsSummary() {
|
||||||
return fSettings.getSummary();
|
return fSettings.getSummary();
|
||||||
}
|
}
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fSettings.load(store);
|
fSettings.load(store);
|
||||||
}
|
}
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSettings.save(store);
|
fSettings.save(store);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.serial;
|
package org.eclipse.tm.internal.terminal.serial;
|
||||||
|
|
||||||
|
import gnu.io.CommPortIdentifier;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import gnu.io.CommPortIdentifier;
|
|
||||||
|
|
||||||
public class SerialProperties {
|
public class SerialProperties {
|
||||||
protected List fSerialPortTable;
|
protected List fSerialPortTable;
|
||||||
protected List fBaudRateTable;
|
protected List fBaudRateTable;
|
||||||
|
|
|
@ -18,7 +18,7 @@ package org.eclipse.tm.internal.terminal.serial;
|
||||||
|
|
||||||
import gnu.io.SerialPort;
|
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 {
|
public class SerialSettings implements ISerialSettings {
|
||||||
protected String fSerialPort;
|
protected String fSerialPort;
|
||||||
|
@ -153,23 +153,23 @@ public class SerialSettings implements ISerialSettings {
|
||||||
getFlowControlString();
|
getFlowControlString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fSerialPort = store.getString("SerialPort", fProperties.getDefaultSerialPort());//$NON-NLS-1$
|
fSerialPort = store.get("SerialPort", fProperties.getDefaultSerialPort());//$NON-NLS-1$
|
||||||
fBaudRate = store.getString("BaudRate", fProperties.getDefaultBaudRate());//$NON-NLS-1$
|
fBaudRate = store.get("BaudRate", fProperties.getDefaultBaudRate());//$NON-NLS-1$
|
||||||
fDataBits = store.getString("DataBits", fProperties.getDefaultDataBits());//$NON-NLS-1$
|
fDataBits = store.get("DataBits", fProperties.getDefaultDataBits());//$NON-NLS-1$
|
||||||
fStopBits = store.getString("StopBits", fProperties.getDefaultStopBits());//$NON-NLS-1$
|
fStopBits = store.get("StopBits", fProperties.getDefaultStopBits());//$NON-NLS-1$
|
||||||
fParity = store.getString("Parity", fProperties.getDefaultParity());//$NON-NLS-1$
|
fParity = store.get("Parity", fProperties.getDefaultParity());//$NON-NLS-1$
|
||||||
fFlowControl = store.getString("FlowControl", fProperties.getDefaultFlowControl());//$NON-NLS-1$
|
fFlowControl = store.get("FlowControl", fProperties.getDefaultFlowControl());//$NON-NLS-1$
|
||||||
fTimeout = store.getString("Timeout",fProperties.getDefaultTimeout()); //$NON-NLS-1$
|
fTimeout = store.get("Timeout",fProperties.getDefaultTimeout()); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
store.set("SerialPort", fSerialPort); //$NON-NLS-1$
|
store.put("SerialPort", fSerialPort); //$NON-NLS-1$
|
||||||
store.set("BaudRate", fBaudRate); //$NON-NLS-1$
|
store.put("BaudRate", fBaudRate); //$NON-NLS-1$
|
||||||
store.set("DataBits", fDataBits); //$NON-NLS-1$
|
store.put("DataBits", fDataBits); //$NON-NLS-1$
|
||||||
store.set("StopBits", fStopBits); //$NON-NLS-1$
|
store.put("StopBits", fStopBits); //$NON-NLS-1$
|
||||||
store.set("Parity", fParity); //$NON-NLS-1$
|
store.put("Parity", fParity); //$NON-NLS-1$
|
||||||
store.set("FlowControl", fFlowControl); //$NON-NLS-1$
|
store.put("FlowControl", fFlowControl); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public SerialProperties getProperties() {
|
public SerialProperties getProperties() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
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.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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
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.autoboxing=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
|
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=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.fallthroughCase=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=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.unusedParameterWhenOverridingConcrete=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=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
|
||||||
|
|
|
@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.tm.terminal;bundle-version="3.3.0",
|
org.eclipse.tm.terminal;bundle-version="3.3.0",
|
||||||
com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)",
|
com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)",
|
||||||
org.eclipse.jsch.core;bundle-version="[1.0.0,2.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
|
Export-Package: org.eclipse.tm.internal.terminal.ssh;x-internal:=true
|
||||||
Bundle-Activator: org.eclipse.tm.internal.terminal.ssh.Activator
|
Bundle-Activator: org.eclipse.tm.internal.terminal.ssh.Activator
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.ssh;
|
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 {
|
public interface ISshSettings {
|
||||||
/**
|
/**
|
||||||
|
@ -68,11 +68,11 @@ public interface ISshSettings {
|
||||||
* Load connection data from a settings store.
|
* Load connection data from a settings store.
|
||||||
* @param store the settings store to access.
|
* @param store the settings store to access.
|
||||||
*/
|
*/
|
||||||
void load(ISettings store);
|
void load(ISettingsStore store);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store connection data into a settings store.
|
* Store connection data into a settings store.
|
||||||
* @param store the settings store to access.
|
* @param store the settings store to access.
|
||||||
*/
|
*/
|
||||||
void save(ISettings store);
|
void save(ISettingsStore store);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
||||||
|
@ -101,10 +101,10 @@ public class SshConnector extends TerminalConnectorImpl {
|
||||||
public String getSettingsSummary() {
|
public String getSettingsSummary() {
|
||||||
return fSettings.getSummary();
|
return fSettings.getSummary();
|
||||||
}
|
}
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fSettings.load(store);
|
fSettings.load(store);
|
||||||
}
|
}
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSettings.save(store);
|
fSettings.save(store);
|
||||||
}
|
}
|
||||||
protected JSch getJsch() {
|
protected JSch getJsch() {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.ssh;
|
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 {
|
public class SshSettings implements ISshSettings {
|
||||||
protected String fHost;
|
protected String fHost;
|
||||||
|
@ -39,28 +39,28 @@ public class SshSettings implements ISshSettings {
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fHost = store.getString("Host");//$NON-NLS-1$
|
fHost = store.get("Host");//$NON-NLS-1$
|
||||||
fUser = store.getString("User");//$NON-NLS-1$
|
fUser = store.get("User");//$NON-NLS-1$
|
||||||
// ISettingsStore providers have to make sure that
|
// ISettingsStore providers have to make sure that
|
||||||
// the password is not saved in some as plain text
|
// the password is not saved in some as plain text
|
||||||
// on disk. [bug 313991]
|
// on disk. [bug 313991]
|
||||||
fPassword = store.getString("Password");//$NON-NLS-1$
|
fPassword = store.get("Password");//$NON-NLS-1$
|
||||||
fPort = store.getString("Port");//$NON-NLS-1$
|
fPort = store.get("Port");//$NON-NLS-1$
|
||||||
fTimeout = store.getString("Timeout");//$NON-NLS-1$
|
fTimeout = store.get("Timeout");//$NON-NLS-1$
|
||||||
fKeepalive = store.getString("Keepalive");//$NON-NLS-1$
|
fKeepalive = store.get("Keepalive");//$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
store.set("Host", fHost);//$NON-NLS-1$
|
store.put("Host", fHost);//$NON-NLS-1$
|
||||||
store.set("User", fUser);//$NON-NLS-1$
|
store.put("User", fUser);//$NON-NLS-1$
|
||||||
store.set("Port", fPort);//$NON-NLS-1$
|
store.put("Port", fPort);//$NON-NLS-1$
|
||||||
// We do *not* store the password in the settings because
|
// We do *not* store the password in the settings because
|
||||||
// this can cause the password to be stored as plain text
|
// this can cause the password to be stored as plain text
|
||||||
// in some settings file
|
// in some settings file
|
||||||
store.set("Timeout", fTimeout);//$NON-NLS-1$
|
store.put("Timeout", fTimeout);//$NON-NLS-1$
|
||||||
store.set("Keepalive", fKeepalive);//$NON-NLS-1$
|
store.put("Keepalive", fKeepalive);//$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src/"/>
|
<classpathentry kind="src" path="src/"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
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.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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
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.autoboxing=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
|
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=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.fallthroughCase=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=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.unusedParameterWhenOverridingConcrete=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=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
|
||||||
|
|
|
@ -8,5 +8,5 @@ Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime,
|
||||||
org.eclipse.tm.terminal;bundle-version="3.3.0"
|
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
|
Export-Package: org.eclipse.tm.internal.terminal.telnet;x-internal:=true
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.telnet;
|
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 {
|
public interface ITelnetSettings {
|
||||||
String getHost();
|
String getHost();
|
||||||
int getNetworkPort();
|
int getNetworkPort();
|
||||||
int getTimeout();
|
int getTimeout();
|
||||||
String getSummary();
|
String getSummary();
|
||||||
void load(ISettings store);
|
void load(ISettingsStore store);
|
||||||
void save(ISettings store);
|
void save(ISettingsStore store);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.io.OutputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||||
|
@ -151,10 +151,10 @@ public class TelnetConnector extends TerminalConnectorImpl {
|
||||||
public String getSettingsSummary() {
|
public String getSettingsSummary() {
|
||||||
return fSettings.getSummary();
|
return fSettings.getSummary();
|
||||||
}
|
}
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fSettings.load(store);
|
fSettings.load(store);
|
||||||
}
|
}
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSettings.save(store);
|
fSettings.save(store);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.telnet;
|
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 {
|
public class TelnetSettings implements ITelnetSettings {
|
||||||
protected String fHost;
|
protected String fHost;
|
||||||
|
@ -51,16 +51,16 @@ public class TelnetSettings implements ITelnetSettings {
|
||||||
return getHost() + ":" + getNetworkPortString(); //$NON-NLS-1$
|
return getHost() + ":" + getNetworkPortString(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fHost = store.getString("Host", fProperties.getDefaultHost());//$NON-NLS-1$
|
fHost = store.get("Host", fProperties.getDefaultHost());//$NON-NLS-1$
|
||||||
fNetworkPort = store.getString("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$
|
fNetworkPort = store.get("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$
|
||||||
fTimeout = store.getString("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$
|
fTimeout = store.get("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
store.set("Host", fHost);//$NON-NLS-1$
|
store.put("Host", fHost);//$NON-NLS-1$
|
||||||
store.set("NetworkPort", fNetworkPort);//$NON-NLS-1$
|
store.put("NetworkPort", fNetworkPort);//$NON-NLS-1$
|
||||||
store.set("Timeout", fTimeout);//$NON-NLS-1$
|
store.put("Timeout", fTimeout);//$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public TelnetProperties getProperties() {
|
public TelnetProperties getProperties() {
|
||||||
|
|
|
@ -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 {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
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.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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=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.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=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
|
||||||
|
|
|
@ -9,7 +9,7 @@ Require-Bundle: org.junit,
|
||||||
org.eclipse.tm.terminal;bundle-version="3.3.0",
|
org.eclipse.tm.terminal;bundle-version="3.3.0",
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime,
|
||||||
org.eclipse.ui
|
org.eclipse.ui
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||||
Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true,
|
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.emulator;x-internal:=true,
|
||||||
org.eclipse.tm.internal.terminal.model;x-internal:=true,
|
org.eclipse.tm.internal.terminal.model;x-internal:=true,
|
||||||
|
|
|
@ -22,13 +22,26 @@ import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.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.TerminalState;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
||||||
|
|
||||||
public class TerminalConnectorFactoryTest extends TestCase {
|
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 static class TerminalControlMock implements ITerminalControl {
|
||||||
|
|
||||||
public void setEncoding(String encoding) {
|
public void setEncoding(String encoding) {
|
||||||
|
@ -85,8 +98,8 @@ public class TerminalConnectorFactoryTest extends TestCase {
|
||||||
public int fWidth;
|
public int fWidth;
|
||||||
public int fHeight;
|
public int fHeight;
|
||||||
public ITerminalControl fControl;
|
public ITerminalControl fControl;
|
||||||
public ISettings fSaveStore;
|
public ISettingsStore fSaveStore;
|
||||||
public ISettings fLoadStore;
|
public ISettingsStore fLoadStore;
|
||||||
public boolean fDisconnect;
|
public boolean fDisconnect;
|
||||||
|
|
||||||
public boolean isLocalEcho() {
|
public boolean isLocalEcho() {
|
||||||
|
@ -112,7 +125,7 @@ public class TerminalConnectorFactoryTest extends TestCase {
|
||||||
return "Summary";
|
return "Summary";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fLoadStore=store;
|
fLoadStore=store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +146,7 @@ public class TerminalConnectorFactoryTest extends TestCase {
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSaveStore=store;
|
fSaveStore=store;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,7 +245,7 @@ public class TerminalConnectorFactoryTest extends TestCase {
|
||||||
public void testLoad() {
|
public void testLoad() {
|
||||||
ConnectorMock mock=new ConnectorMock();
|
ConnectorMock mock=new ConnectorMock();
|
||||||
TerminalConnector c = makeTerminalConnector(mock);
|
TerminalConnector c = makeTerminalConnector(mock);
|
||||||
ISettings s=new Settings();
|
ISettingsStore s=new SettingsMock();
|
||||||
c.load(s);
|
c.load(s);
|
||||||
// the load is called after the connect...
|
// the load is called after the connect...
|
||||||
assertNull(mock.fLoadStore);
|
assertNull(mock.fLoadStore);
|
||||||
|
@ -243,7 +256,7 @@ public class TerminalConnectorFactoryTest extends TestCase {
|
||||||
public void testSave() {
|
public void testSave() {
|
||||||
ConnectorMock mock=new ConnectorMock();
|
ConnectorMock mock=new ConnectorMock();
|
||||||
TerminalConnector c = makeTerminalConnector(mock);
|
TerminalConnector c = makeTerminalConnector(mock);
|
||||||
ISettings s=new Settings();
|
ISettingsStore s=new SettingsMock();
|
||||||
c.save(s);
|
c.save(s);
|
||||||
assertNull(mock.fSaveStore);
|
assertNull(mock.fSaveStore);
|
||||||
c.connect(new TerminalControlMock());
|
c.connect(new TerminalControlMock());
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
package org.eclipse.tm.internal.terminal.connector;
|
package org.eclipse.tm.internal.terminal.connector;
|
||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
@ -23,13 +22,26 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.tm.internal.terminal.connector.TerminalConnector.Factory;
|
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.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.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.TerminalState;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
|
||||||
|
|
||||||
public class TerminalConnectorTest extends TestCase {
|
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 static class TerminalControlMock implements ITerminalControl {
|
||||||
|
|
||||||
public void setEncoding(String encoding) {
|
public void setEncoding(String encoding) {
|
||||||
|
@ -86,8 +98,8 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
public int fWidth;
|
public int fWidth;
|
||||||
public int fHeight;
|
public int fHeight;
|
||||||
public ITerminalControl fControl;
|
public ITerminalControl fControl;
|
||||||
public ISettings fSaveStore;
|
public ISettingsStore fSaveStore;
|
||||||
public ISettings fLoadStore;
|
public ISettingsStore fLoadStore;
|
||||||
public boolean fDisconnect;
|
public boolean fDisconnect;
|
||||||
|
|
||||||
public boolean isLocalEcho() {
|
public boolean isLocalEcho() {
|
||||||
|
@ -113,7 +125,7 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
return "Summary";
|
return "Summary";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fLoadStore=store;
|
fLoadStore=store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +147,7 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSaveStore=store;
|
fSaveStore=store;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,7 +224,7 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
public void testLoad() {
|
public void testLoad() {
|
||||||
ConnectorMock mock=new ConnectorMock();
|
ConnectorMock mock=new ConnectorMock();
|
||||||
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
|
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
|
||||||
ISettings s=new Settings();
|
ISettingsStore s=new SettingsMock();
|
||||||
c.load(s);
|
c.load(s);
|
||||||
// the load is called after the connect...
|
// the load is called after the connect...
|
||||||
assertNull(mock.fLoadStore);
|
assertNull(mock.fLoadStore);
|
||||||
|
@ -223,7 +235,7 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
public void testSave() {
|
public void testSave() {
|
||||||
ConnectorMock mock=new ConnectorMock();
|
ConnectorMock mock=new ConnectorMock();
|
||||||
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
|
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
|
||||||
ISettings s=new Settings();
|
ISettingsStore s=new SettingsMock();
|
||||||
c.save(s);
|
c.save(s);
|
||||||
assertNull(mock.fSaveStore);
|
assertNull(mock.fSaveStore);
|
||||||
c.connect(new TerminalControlMock());
|
c.connect(new TerminalControlMock());
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.model;
|
package org.eclipse.tm.internal.terminal.model;
|
||||||
|
|
||||||
import org.eclipse.tm.terminal.model.ITerminalTextData;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.eclipse.tm.terminal.model.ITerminalTextData;
|
||||||
|
|
||||||
public class SnapshotChangesTest extends TestCase {
|
public class SnapshotChangesTest extends TestCase {
|
||||||
/**
|
/**
|
||||||
* @param change
|
* @param change
|
||||||
|
|
|
@ -18,7 +18,7 @@ import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
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!");
|
//throw new RuntimeException("XXX problems\nSpeedTest\nXXX!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fSettings.load(store);
|
fSettings.load(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public class SpeedTestConnector extends TerminalConnectorImpl {
|
||||||
return new SpeedTestSettingsPage(fSettings);
|
return new SpeedTestSettingsPage(fSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
fSettings.save(store);
|
fSettings.save(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
package org.eclipse.tm.internal.terminal.speedtest;
|
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 {
|
public class SpeedTestSettings {
|
||||||
String fInputFile="";
|
String fInputFile="";
|
||||||
|
@ -36,15 +36,15 @@ public class SpeedTestSettings {
|
||||||
void setInputFile(String testFile) {
|
void setInputFile(String testFile) {
|
||||||
fInputFile = testFile;
|
fInputFile = testFile;
|
||||||
}
|
}
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
fInputFile=store.getString("inputFile");
|
fInputFile=store.get("inputFile");
|
||||||
fBufferSize=store.getString("bufferSize");
|
fBufferSize=store.get("bufferSize");
|
||||||
fThrottle=store.getString("throttle");
|
fThrottle=store.get("throttle");
|
||||||
}
|
}
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
store.set("inputFile", fInputFile);
|
store.put("inputFile", fInputFile);
|
||||||
store.set("bufferSize", fBufferSize);
|
store.put("bufferSize", fBufferSize);
|
||||||
store.set("throttle", fThrottle);
|
store.put("throttle", fThrottle);
|
||||||
}
|
}
|
||||||
public String getThrottleString() {
|
public String getThrottleString() {
|
||||||
return fThrottle;
|
return fThrottle;
|
||||||
|
|
|
@ -17,10 +17,19 @@ package org.eclipse.tm.internal.terminal.test.terminalcanvas;
|
||||||
* For a list of all SWT example snippets see
|
* For a list of all SWT example snippets see
|
||||||
* http://www.eclipse.org/swt/snippets/
|
* http://www.eclipse.org/swt/snippets/
|
||||||
*/
|
*/
|
||||||
import org.eclipse.swt.*;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.graphics.*;
|
import org.eclipse.swt.graphics.GC;
|
||||||
import org.eclipse.swt.layout.*;
|
import org.eclipse.swt.graphics.Image;
|
||||||
import org.eclipse.swt.widgets.*;
|
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 {
|
public class Snippet48 {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src/"/>
|
<classpathentry kind="src" path="src/"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
|
|
@ -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.annotation.nullanalysis=disabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
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.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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=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.annotationSuperInterface=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
|
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.deprecationWhenOverridingDeprecatedMethod=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=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.explicitlyClosedAutoCloseable=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
|
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.fieldHiding=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
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.incompatibleNonInheritedInterfaceMethod=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=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.localVariableHiding=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
|
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
|
||||||
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
|
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.missingEnumCaseDespiteDefault=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
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.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
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.noEffectAssignment=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=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.potentiallyUnclosedCloseable=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
|
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
|
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
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.suppressOptionalErrors=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
|
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.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.uncheckedTypeOperation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
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.unnecessaryTypeCheck=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=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.unusedImport=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=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.unusedParameter=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=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
|
||||||
|
|
|
@ -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
|
|
|
@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.core.runtime,
|
||||||
org.eclipse.ui
|
org.eclipse.ui
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||||
Bundle-ClassPath: .
|
Bundle-ClassPath: .
|
||||||
Export-Package: org.eclipse.tm.internal.terminal.connector;x-friends:="org.eclipse.tm.terminal.test",
|
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",
|
org.eclipse.tm.internal.terminal.control;x-friends:="org.eclipse.tm.terminal.view",
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.tm.internal.terminal.control.impl.TerminalMessages;
|
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.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.ITerminalConnector;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
|
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.Logger;
|
||||||
|
@ -93,7 +93,7 @@ public class TerminalConnector implements ITerminalConnector {
|
||||||
* The store might be set before the real connector is initialized.
|
* The store might be set before the real connector is initialized.
|
||||||
* This keeps the value until the connector is created.
|
* This keeps the value until the connector is created.
|
||||||
*/
|
*/
|
||||||
private ISettings fStore;
|
private ISettingsStore fStore;
|
||||||
/**
|
/**
|
||||||
* Constructor for the terminal connector.
|
* Constructor for the terminal connector.
|
||||||
*
|
*
|
||||||
|
@ -173,7 +173,7 @@ public class TerminalConnector implements ITerminalConnector {
|
||||||
public boolean isLocalEcho() {
|
public boolean isLocalEcho() {
|
||||||
return getConnectorImpl().isLocalEcho();
|
return getConnectorImpl().isLocalEcho();
|
||||||
}
|
}
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
if(fConnector==null) {
|
if(fConnector==null) {
|
||||||
fStore=store;
|
fStore=store;
|
||||||
} else {
|
} else {
|
||||||
|
@ -183,7 +183,7 @@ public class TerminalConnector implements ITerminalConnector {
|
||||||
public ISettingsPage makeSettingsPage() {
|
public ISettingsPage makeSettingsPage() {
|
||||||
return getConnectorImpl().makeSettingsPage();
|
return getConnectorImpl().makeSettingsPage();
|
||||||
}
|
}
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
// no need to save the settings: it cannot have changed
|
// no need to save the settings: it cannot have changed
|
||||||
// because we are not initialized....
|
// because we are not initialized....
|
||||||
if(fConnector!=null)
|
if(fConnector!=null)
|
||||||
|
|
|
@ -37,7 +37,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#addListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener)
|
* @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) {
|
public void addListener(Listener listener) {
|
||||||
Assert.isNotNull(listener);
|
Assert.isNotNull(listener);
|
||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
|
@ -46,7 +45,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#removeListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener)
|
* @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) {
|
public void removeListener(Listener listener) {
|
||||||
Assert.isNotNull(listener);
|
Assert.isNotNull(listener);
|
||||||
listeners.remove(listener);
|
listeners.remove(listener);
|
||||||
|
@ -69,7 +67,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessage()
|
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessage()
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public final String getMessage() {
|
public final String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +74,6 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType()
|
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType()
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public final int getMessageType() {
|
public final int getMessageType() {
|
||||||
return messageType;
|
return messageType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
|
||||||
* <p>
|
|
||||||
* <strong>EXPERIMENTAL</strong>. 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 <a href="http://www.eclipse.org/tm/">Target Management</a> team.
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public interface ISettings extends IAdaptable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the settings from the given map. Calling this method
|
|
||||||
* will overwrite all previous set settings.
|
|
||||||
* <p>
|
|
||||||
* <b>Note:</b> 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 <code>null</code>.
|
|
||||||
*/
|
|
||||||
public void set(Map<String, Object> 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 <code>null</code>.
|
|
||||||
*/
|
|
||||||
public void addAll(Map<String, ?> 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 <code>null</code> and is different from the current value, the new
|
|
||||||
* value will be written to the settings. If the value is <code>null</code>, the
|
|
||||||
* key and the currently stored value are removed from the settings.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param value The value.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the value had been applied to the settings, <code>false</code> 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 <code>Long</code> object and stored to the
|
|
||||||
* settings store via <code>set(java.lang.String, java.lang.Object)</code>.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param value The value.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the value had been applied to the settings, <code>false</code> otherwise.
|
|
||||||
*
|
|
||||||
* @see <code>set(java.lang.String, java.lang.Object)</code>
|
|
||||||
*/
|
|
||||||
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 <code>Integer</code> object and stored to the
|
|
||||||
* settings via <code>set(java.lang.String, java.lang.Object)</code>.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param value The value.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the value had been applied to the settings, <code>false</code> otherwise.
|
|
||||||
*
|
|
||||||
* @see <code>set(java.lang.String, java.lang.Object)</code>
|
|
||||||
*/
|
|
||||||
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 <code>Boolean</code> object and stored to the
|
|
||||||
* settings via <code>set(java.lang.String, java.lang.Object)</code>.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param value The value.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the value had been applied to the settings, <code>false</code> otherwise.
|
|
||||||
*
|
|
||||||
* @see <code>set(java.lang.String, java.lang.Object)</code>
|
|
||||||
*/
|
|
||||||
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 <code>Float</code> object and stored to the
|
|
||||||
* settings via <code>set(java.lang.String, java.lang.Object)</code>.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param value The value.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the value had been applied to the settings, <code>false</code> otherwise.
|
|
||||||
*
|
|
||||||
* @see <code>set(java.lang.String, java.lang.Object)</code>
|
|
||||||
*/
|
|
||||||
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 <code>Double</code> object and stored to the
|
|
||||||
* settings via <code>set(java.lang.String, java.lang.Object)</code>.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param value The value.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the value had been applied to the settings, <code>false</code> otherwise.
|
|
||||||
*
|
|
||||||
* @see <code>set(java.lang.String, java.lang.Object)</code>
|
|
||||||
*/
|
|
||||||
public boolean set(String key, double value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all settings. The result map is read-only.
|
|
||||||
*
|
|
||||||
* @return A map containing all settings.
|
|
||||||
*/
|
|
||||||
public Map<String, Object> getAll();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting does not exist,
|
|
||||||
* <code>null</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value or <code>null</code>.
|
|
||||||
*/
|
|
||||||
public Object get(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting exist and is of type
|
|
||||||
* <code>java.lang.String</code>, the value casted to <code>java.lang.String</code>
|
|
||||||
* is returned. In all other cases, <code>null</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value casted <code>java.lang.String</code> or <code>null</code>.
|
|
||||||
*/
|
|
||||||
public String getString(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting exist and is of type
|
|
||||||
* <code>java.lang.String</code>, the value casted to <code>java.lang.String</code>
|
|
||||||
* is returned. In all other cases, the given default value is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @param defaultValue The default value or <code>null</code>.
|
|
||||||
*
|
|
||||||
* @return The stored value casted <code>java.lang.String</code> 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
|
|
||||||
* <code>java.lang.Long</code>, the value converted to an long value is returned. In
|
|
||||||
* all other cases, <code>-1</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value converted to a long value or <code>-1</code>.
|
|
||||||
*/
|
|
||||||
public long getLong(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting exist and is of type
|
|
||||||
* <code>java.lang.Integer</code>, the value converted to an integer value is returned.
|
|
||||||
* In all other cases, <code>-1</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value converted to an integer value or <code>-1</code>.
|
|
||||||
*/
|
|
||||||
public int getInt(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting exist and is of type
|
|
||||||
* <code>java.lang.Boolean</code>, the value converted to an boolean value is returned.
|
|
||||||
* In all other cases, <code>false</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value converted to an boolean value or <code>false</code>.
|
|
||||||
*/
|
|
||||||
public boolean getBoolean(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting exist and is of type
|
|
||||||
* <code>java.lang.Float</code>, the value converted to an float value is returned.
|
|
||||||
* In all other cases, <code>Float.NaN</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value converted to a float value or <code>Float.NaN</code>.
|
|
||||||
*/
|
|
||||||
public float getFloat(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queries the value stored under the given key. If the setting exist and is of type
|
|
||||||
* <code>java.lang.Double</code>, the value converted to an double value is returned.
|
|
||||||
* In all other cases, <code>Double.NaN</code> is returned.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>!
|
|
||||||
* @return The stored value converted to a double value or <code>Double.NaN</code>.
|
|
||||||
*/
|
|
||||||
public double getDouble(String key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove all settings.
|
|
||||||
*/
|
|
||||||
public void clear();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the settings are empty or not.
|
|
||||||
*
|
|
||||||
* @return <code>True</code> if the settings are empty, <code>false</code> if not.
|
|
||||||
*/
|
|
||||||
public boolean isEmpty();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the settings contains the given key.
|
|
||||||
*
|
|
||||||
* @param key The key. Must not be <code>null</code>.
|
|
||||||
* @return <code>True</code> if the settings contains the key, <code>false</code> if not.
|
|
||||||
*/
|
|
||||||
public boolean containsKey(String key);
|
|
||||||
}
|
|
|
@ -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
|
||||||
|
* <p>
|
||||||
|
* <strong>EXPERIMENTAL</strong>. 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 <a href="http://www.eclipse.org/tm/">Target Management</a> team.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
}
|
|
@ -124,14 +124,14 @@ public interface ITerminalConnector extends IAdaptable {
|
||||||
* @param store a string based data store. Short keys like "foo" can be used to
|
* @param store a string based data store. Short keys like "foo" can be used to
|
||||||
* store the state of the connection.
|
* store the state of the connection.
|
||||||
*/
|
*/
|
||||||
void load(ISettings store);
|
void load(ISettingsStore store);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the view or dialog containing the terminal is closed,
|
* When the view or dialog containing the terminal is closed,
|
||||||
* the state of the connection is saved into the settings store <code>store</code>
|
* the state of the connection is saved into the settings store <code>store</code>
|
||||||
* @param store
|
* @param store
|
||||||
*/
|
*/
|
||||||
void save(ISettings store);
|
void save(ISettingsStore store);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME should not have UI related stuff in ITerminalConnector, since
|
* FIXME should not have UI related stuff in ITerminalConnector, since
|
||||||
|
|
|
@ -8,13 +8,10 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* 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.tm.internal.terminal.provisional.api.ISettings;
|
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Settings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses an array of {@link ISettings} to find a value.
|
* Uses an array of {@link ISettingsStore} to find a value.
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
|
* <strong>EXPERIMENTAL</strong>. 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
|
* 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 <a href="http://www.eclipse.org/tm/">Target Management</a> team.
|
* the <a href="http://www.eclipse.org/tm/">Target Management</a> team.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
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.
|
* @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.
|
* first store in the list.
|
||||||
*/
|
*/
|
||||||
public LayeredSettingsStore(ISettings[] stores) {
|
public LayeredSettingsStore(ISettingsStore[] stores) {
|
||||||
fStores=stores;
|
fStores=stores;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -39,21 +36,27 @@ public class LayeredSettingsStore extends Settings {
|
||||||
* @param s1 first store
|
* @param s1 first store
|
||||||
* @param s2 second store
|
* @param s2 second store
|
||||||
*/
|
*/
|
||||||
public LayeredSettingsStore(ISettings s1, ISettings s2) {
|
public LayeredSettingsStore(ISettingsStore s1, ISettingsStore s2) {
|
||||||
this(new ISettings[]{s1,s2});
|
this(new ISettingsStore[]{s1,s2});
|
||||||
}
|
}
|
||||||
|
public String get(String key) {
|
||||||
public Object get(String key) {
|
|
||||||
for (int i = 0; i < fStores.length; i++) {
|
for (int i = 0; i < fStores.length; i++) {
|
||||||
Object value=fStores[i].get(key);
|
String value=fStores[i].get(key);
|
||||||
if (value!=null)
|
if(value!=null)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean set(String key, Object value) {
|
public String get(String key, String defaultValue) {
|
||||||
return fStores[0].set(key,value);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -13,12 +13,11 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.provisional.api;
|
package org.eclipse.tm.internal.terminal.provisional.api;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Platform;
|
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin;
|
import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin;
|
||||||
|
|
||||||
|
@ -51,14 +50,24 @@ public final class Logger {
|
||||||
private static PrintStream logStream;
|
private static PrintStream logStream;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
IPath logFile = Platform.getStateLocation(TerminalPlugin.getDefault().getBundle());
|
String logFile = null;
|
||||||
if (logFile != null && logFile.toFile().isDirectory()) {
|
//TODO I think this should go into the workspace metadata instead.
|
||||||
logFile = logFile.append("tmterminal.log"); //$NON-NLS-1$
|
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 {
|
try {
|
||||||
logStream = new PrintStream(new FileOutputStream(logFile.toFile(), true));
|
logStream = new PrintStream(new FileOutputStream(logFile, true));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logStream = System.err;
|
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);
|
ex.printStackTrace(logStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* 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;
|
import org.eclipse.core.runtime.Preferences;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import org.eclipse.core.runtime.Preferences;
|
||||||
* the <a href="http://www.eclipse.org/tm/">Target Management</a> team.
|
* the <a href="http://www.eclipse.org/tm/">Target Management</a> team.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public class PreferenceSettingStore extends org.eclipse.tm.internal.terminal.provisional.api.Settings {
|
public class PreferenceSettingStore implements ISettingsStore {
|
||||||
private final String fPrefix;
|
private final String fPrefix;
|
||||||
private final Preferences fPreferences;
|
private final Preferences fPreferences;
|
||||||
|
|
||||||
|
@ -35,16 +35,19 @@ public class PreferenceSettingStore extends org.eclipse.tm.internal.terminal.pro
|
||||||
fPreferences=preferences;
|
fPreferences=preferences;
|
||||||
fPrefix=prefix;
|
fPrefix=prefix;
|
||||||
}
|
}
|
||||||
|
public String get(String key) {
|
||||||
public Object get(String key) {
|
|
||||||
return fPreferences.getString(makeKey(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) {
|
return value;
|
||||||
if (value instanceof String) {
|
}
|
||||||
fPreferences.setValue(makeKey(key), (String)value);
|
|
||||||
}
|
public void put(String key, String value) {
|
||||||
return true;
|
fPreferences.setValue(makeKey(key), value);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param key
|
* @param key
|
|
@ -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<String, Object> settings = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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<String, Object> getAll() {
|
|
||||||
return Collections.unmodifiableMap(new HashMap<String, Object>(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<String, Object> 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<String, ?> 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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.tm.internal.terminal.provisional.api.provider;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
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.ITerminalControl;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
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
|
* @param store a string based data store. Short keys like "foo" can be used
|
||||||
* to store the state of the connection.
|
* to store the state of the connection.
|
||||||
*/
|
*/
|
||||||
public void load(ISettings store) {
|
public void load(ISettingsStore store) {
|
||||||
// do nothing by default
|
// do nothing by default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public abstract class TerminalConnectorImpl {
|
||||||
*
|
*
|
||||||
* @param store the store for persisting settings.
|
* @param store the store for persisting settings.
|
||||||
*/
|
*/
|
||||||
public void save(ISettings store) {
|
public void save(ISettingsStore store) {
|
||||||
// do nothing by default
|
// do nothing by default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue