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