Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-11-22 07:14:14 -0500
committerTobias Schwarz2012-11-22 07:14:39 -0500
commit7aeb78abbc0eac3c2a64183220e6f01312206537 (patch)
treeaba05615d3e4f6939fb0c661ed96d7a4ccfc485f
parentd9007711ed5119abfaad851955898a520d7642f4 (diff)
downloadorg.eclipse.tcf-7aeb78abbc0eac3c2a64183220e6f01312206537.tar.gz
org.eclipse.tcf-7aeb78abbc0eac3c2a64183220e6f01312206537.tar.xz
org.eclipse.tcf-7aeb78abbc0eac3c2a64183220e6f01312206537.zip
[Target Explorer] fix editor dirty state
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java28
2 files changed, 31 insertions, 9 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java
index b9e75bde2..bc8487db6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.ui.editor;
+import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.swt.SWT;
@@ -38,6 +39,17 @@ public class SourceLookupEditorPage extends AbstractTcfLaunchTabContainerEditorP
performApply(getLaunchConfig(getPeerModel(getEditorInput())));
checkLaunchConfigDirty();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ boolean oldDirty = getEditor().isDirty() || checkLaunchConfigDirty();
+ super.initializeFrom(configuration);
+ if (!oldDirty && checkLaunchConfigDirty()) {
+ extractData();
+ }
+ }
};
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java
index 49f5963a9..e6cc77fd2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java
@@ -77,7 +77,7 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable,
super(parent, form.getToolkit(), titleBar ? (ExpandableComposite.TITLE_BAR | style) : style);
initialize(form);
configureSection(getSection());
- }
+ }
/**
* Configure the section.
@@ -171,7 +171,7 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable,
// Cursor needs to be explicitly disposed
tlb.addDisposeListener(new DisposeListener() {
@Override
- public void widgetDisposed(DisposeEvent e) {
+ public void widgetDisposed(DisposeEvent e) {
if (cursor.isDisposed() == false) {
cursor.dispose();
}
@@ -215,7 +215,9 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable,
* @param dirty <code>True</code> to mark the section dirty, <code>false</code> otherwise.
*/
public final void markDirty(boolean dirty) {
- if (dirty) markDirty();
+ if (dirty) {
+ markDirty();
+ }
else {
// For now, there is no direct way to reset the dirty state,
// and the refresh() method is setting back both flags (stale and dirty).
@@ -231,7 +233,9 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable,
}
});
f.setBoolean(this, dirty);
- if (getManagedForm() != null) getManagedForm().dirtyStateChanged();
+ if (getManagedForm() != null) {
+ getManagedForm().dirtyStateChanged();
+ }
} catch (Exception e) { /* ignored on purpose */ }
}
}
@@ -243,8 +247,10 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable,
public void commit(boolean onSave) {
// commit is reseting the dirty state
boolean hasBeenDirty = isDirty();
- super.commit(onSave);
- if (hasBeenDirty) getManagedForm().dirtyStateChanged();
+ super.commit(onSave);
+ if (hasBeenDirty) {
+ markDirty();
+ }
}
/* (non-Javadoc)
@@ -255,9 +261,13 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable,
// refresh is reseting both the stale and the dirty state
boolean hasBeenStale = isStale();
boolean hasBeenDirty = isDirty();
- super.refresh();
- if (hasBeenStale) getManagedForm().staleStateChanged();
- if (hasBeenDirty) getManagedForm().dirtyStateChanged();
+ super.refresh();
+ if (hasBeenStale) {
+ getManagedForm().staleStateChanged();
+ }
+ if (hasBeenDirty) {
+ getManagedForm().dirtyStateChanged();
+ }
}
/* (non-Javadoc)

Back to the top