Merge "Quick fix for dirty logic"
diff --git a/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/Messages.properties b/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/Messages.properties
index 8a39f3d..5d24177 100644
--- a/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/Messages.properties
+++ b/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/Messages.properties
@@ -57,7 +57,7 @@
 
 
 # --- framework Editor ---
-serverEditorLocationsSection=Felix framework instance locations
+serverEditorLocationsSection=OSGi framework instance locations
 serverEditorLocationsDescription=Specify the location path. Bundles are deployed here and framework instance will run from this location.  No modules must be published here to make changes.
 serverEditorLocationsDescription2=Specify the location path. Bundles are deployed here and framework instance will run from this location.  No modules must be published here to make changes.
 serverEditorGeneralSection=Framework Options
@@ -75,7 +75,7 @@
 # Note: The argument for the following three strings will be the string for
 #       one of serverEditorDoesNotModify or serverEditorTakesControl or and empty string.
 serverEditorServerDirMetadata=Use workspace metadata {0}
-serverEditorServerDirInstall=Use Felix installation {0}
+serverEditorServerDirInstall=Use OSGi Framework installation {0}
 serverEditorServerDirCustom=Use custom location {0}
 serverEditorServerDir=Framework instance path:
 serverEditorDeployDir=Deploy path:
diff --git a/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/internal/editor/TargetDefinitionEditorPart.java b/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/internal/editor/TargetDefinitionEditorPart.java
index c44531a..f25702c 100644
--- a/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/internal/editor/TargetDefinitionEditorPart.java
+++ b/plugins/org.eclipse.libra.framework.ui/src/org/eclipse/libra/framework/ui/internal/editor/TargetDefinitionEditorPart.java
@@ -232,7 +232,7 @@
 
 	}
 
-	private void makeDirty(final ITargetDefinition definition) {
+	void makeDirty(final ITargetDefinition definition) {
 		//This command does nothing but execute sets the dirty flag
 		//for the editor because the content of the target definition has
 		//changed
@@ -436,8 +436,11 @@
 		fOSCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, (String[]) fOSChoices.toArray(new String[fOSChoices.size()]));
 		fOSCombo.addModifyListener(new ModifyListener() {
 			public void modifyText(ModifyEvent e) {
-				getTargetDefinition().setOS(getModelValue(fOSCombo.getText()));
-				makeDirty(getTargetDefinition());
+				String val = getModelValue(fOSCombo.getText());
+				if(getTargetDefinition().getOS()  != null && !getTargetDefinition().getOS().equals(val) )
+					makeDirty(getTargetDefinition());
+				getTargetDefinition().setOS(val);
+				
 			}
 		});
 
@@ -446,8 +449,10 @@
 		fWSCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, (String[]) fWSChoices.toArray(new String[fWSChoices.size()]));
 		fWSCombo.addModifyListener(new ModifyListener() {
 			public void modifyText(ModifyEvent e) {
-				getTargetDefinition().setWS(getModelValue(fWSCombo.getText()));
-				makeDirty(getTargetDefinition());
+				String val = getModelValue(fWSCombo.getText());
+				if(getTargetDefinition().getWS()  != null && !getTargetDefinition().getWS().equals(val) )
+					makeDirty(getTargetDefinition());
+				getTargetDefinition().setWS(val);
 			}
 		});
 
@@ -456,8 +461,10 @@
 		fArchCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, (String[]) fArchChoices.toArray(new String[fArchChoices.size()]));
 		fArchCombo.addModifyListener(new ModifyListener() {
 			public void modifyText(ModifyEvent e) {
-				getTargetDefinition().setArch(getModelValue(fArchCombo.getText()));
-				makeDirty(getTargetDefinition());
+				String val = getModelValue(fArchCombo.getText());
+				if(getTargetDefinition().getArch()  != null && !getTargetDefinition().getArch().equals(val) )
+					makeDirty(getTargetDefinition());
+				getTargetDefinition().setArch(val);
 			}
 		});
 
@@ -470,8 +477,10 @@
 				int index = value.indexOf("-"); //$NON-NLS-1$
 				if (index > 0)
 					value = value.substring(0, index);
-				getTargetDefinition().setNL(getModelValue(value));
-				makeDirty(getTargetDefinition());
+				String val = getModelValue(value);
+				if(getTargetDefinition().getNL()  != null && !getTargetDefinition().getNL().equals(val) )
+					makeDirty(getTargetDefinition());
+				getTargetDefinition().setNL(val);
 			}
 		});
 	}
@@ -560,8 +569,11 @@
 		fProgramArgs = SWTFactory.createText(programGroup, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL, 1, 200, 60, GridData.FILL_BOTH);
 		fProgramArgs.addModifyListener(new ModifyListener() {
 			public void modifyText(ModifyEvent e) {
-				getTargetDefinition().setProgramArguments(fProgramArgs.getText().trim());
-				makeDirty(getTargetDefinition());
+				String val = fProgramArgs.getText().trim();
+				if(getTargetDefinition().getProgramArguments()  != null && !getTargetDefinition().getProgramArguments().equals(val) )
+					makeDirty(getTargetDefinition());
+				getTargetDefinition().setProgramArguments(val);
+			
 			}
 		});
 
@@ -578,8 +590,10 @@
 		fVMArgs = SWTFactory.createText(vmGroup, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL, 1, 200, 60, GridData.FILL_BOTH);
 		fVMArgs.addModifyListener(new ModifyListener() {
 			public void modifyText(ModifyEvent e) {
-				getTargetDefinition().setVMArguments(fVMArgs.getText().trim());
-				makeDirty(getTargetDefinition());
+				String val = fVMArgs.getText().trim();
+				if(getTargetDefinition().getVMArguments()  != null && !getTargetDefinition().getVMArguments().equals(val) )
+					makeDirty(getTargetDefinition());
+				getTargetDefinition().setVMArguments(val);
 			}
 		});