1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[179363] to avoid having changed properties reset by unchanged default properties, I've added code to check if the user changed the ServerLauncherPropertiesServiceElement. The explicit properties are set only when the service element changes.

This commit is contained in:
David McKnight 2007-04-04 15:09:55 +00:00
parent 4b498e3e85
commit efa8873ec5
3 changed files with 23 additions and 18 deletions

View file

@ -26,6 +26,7 @@ import org.eclipse.swt.graphics.Image;
public class ServerLauncherPropertiesServiceElement extends RSEModelServiceElement
{
protected IServerLauncherProperties _launcherProperties;
private boolean _userModified = false;
public ServerLauncherPropertiesServiceElement(IHost host, ServiceElement parent, IServerLauncherProperties launcherProperties)
{
@ -56,10 +57,16 @@ public class ServerLauncherPropertiesServiceElement extends RSEModelServiceEleme
public void childChanged(ServiceElement element)
{
_userModified = true;
_launcherProperties.restoreFromProperties();
_launcherProperties.commit();
getParent().childChanged(element);
}
public boolean userModified()
{
return _userModified;
}
public void commit()
{

View file

@ -157,6 +157,8 @@ public class ServicesForm extends SystemBaseForm implements ICheckStateListener
return _factoryViewer.getControl();
}
private void createFactoryViewer(Composite parent)
{
// Create the table viewer.
@ -199,23 +201,9 @@ public class ServicesForm extends SystemBaseForm implements ICheckStateListener
tableTree.setToolTipText(_serviceTooltip);
/*
TableLayout tableLayout = new TableLayout();
TreeColumn factoryColumn = new TreeColumn(tableTree, SWT.LEFT);
factoryColumn.setText("Property");
tableLayout.addColumnData(new ColumnPixelData(100));
tableTree.setLayout(tableLayout);
TreeColumn fileServiceColumn = new TreeColumn(tableTree, SWT.LEFT);
fileServiceColumn.setText("Value");
tableLayout.addColumnData(new ColumnPixelData(120));
*/
_serviceViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
// Adjust the table viewer.
//String[] properties = new String[] {"STRING", "STRING"};
//_serviceViewer.setColumnProperties(properties);
_serviceViewer.setContentProvider(new ServiceTableContentProvider());
_serviceViewer.setLabelProvider(new ServiceTableLabelProvider());
@ -304,4 +292,5 @@ public class ServicesForm extends SystemBaseForm implements ICheckStateListener
}
return description != null ? description : ""; //$NON-NLS-1$
}
}

View file

@ -77,6 +77,7 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
return control;
}
protected ServiceElement[] getServiceElements()
{
@ -207,11 +208,19 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
ServerLauncherPropertiesServiceElement[] elements = getPropertiesServiceElement();
if (elements.length > 0)
{
IServerLauncherProperties properties = elements[0].getServerLauncherProperties();
ServerLauncherPropertiesServiceElement element = elements[0];
if (element.userModified())
{
IServerLauncherProperties properties = element.getServerLauncherProperties();
IConnectorService rserv = ss.getConnectorService();
properties.saveToProperties();
IConnectorService rserv = ss.getConnectorService();
properties.saveToProperties();
rserv.setRemoteServerLauncherProperties(properties);
}
else
{ // just using defaults
}
/*
PropertyElement[] properties = elements[i].getProperties();
for (int p = 0; p < properties.length; p++)