1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-21 07:05:58 +02:00

bug 153253 - formatting to facilitate debug

This commit is contained in:
David Dykstal 2006-08-17 17:47:13 +00:00
parent 59801af006
commit ef8791b9f2

View file

@ -22,113 +22,92 @@ import org.eclipse.rse.model.ISystemProfile;
* This class is the root node of an RSE DOM. Each * This class is the root node of an RSE DOM. Each
* RSEDOM represents the properties of a profile to persist. * RSEDOM represents the properties of a profile to persist.
*/ */
public class RSEDOM extends RSEDOMNode public class RSEDOM extends RSEDOMNode {
{
/** /*
* * Recommended for serializable objects. This should be updated if there is a schema change.
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private boolean _saveScheduled = false; private boolean _saveScheduled = false;
private transient ISystemProfile _profile; private transient ISystemProfile _profile;
public RSEDOM(ISystemProfile profile) public RSEDOM(ISystemProfile profile) {
{
super(null, TYPE_PROFILE, profile.getName()); super(null, TYPE_PROFILE, profile.getName());
_profile = profile; _profile = profile;
} }
public RSEDOM(String profileName) public RSEDOM(String profileName) {
{
super(null, TYPE_PROFILE, profileName); super(null, TYPE_PROFILE, profileName);
_profile = null; _profile = null;
} }
public ISystemProfile getProfile() public ISystemProfile getProfile() {
{
return _profile; return _profile;
} }
/** /**
* Indicate that this DOM needs to be saved * Indicate that this DOM needs to be saved
*/ */
public void markForSave() public void markForSave() {
{ if (!restoring && !_needsSave) {
if (!restoring && !_needsSave)
{
//System.out.println("RSEDOM "+getName() + " needs saving");
_needsSave = true; _needsSave = true;
} }
} }
/** /**
* Indicate that this DOM has been saved * Indicate that this DOM has been saved
*
*/ */
public void markUpdated() public void markUpdated() {
{ if (_needsSave) {
if (_needsSave)
{
//System.out.println("RSEDOM "+getName() + " is up to date");
_needsSave = false; _needsSave = false;
_saveScheduled = false; _saveScheduled = false;
super.markUpdated(); super.markUpdated();
} }
} }
/** /**
* Returns whether this DOM is scheduled to be saved * @return true if this DOM is scheduled to be saved
* @return
*/ */
public boolean saveScheduled() public boolean saveScheduled() {
{
return _saveScheduled; return _saveScheduled;
} }
/** /**
* Indicate that this DOM is scheduled to be saved * Indicate that this DOM is scheduled to be saved
*/ */
public void markSaveScheduled() public void markSaveScheduled() {
{ if (!_saveScheduled) {
if (!_saveScheduled)
{
_saveScheduled = true; _saveScheduled = true;
} }
} }
/** /**
* Has the DOM changed since last update? * @return true if this DOM has the DOM changed since last saved or restored.
*/ */
public boolean needsSave() public boolean needsSave() {
{
return _needsSave; return _needsSave;
} }
public void print(RSEDOMNode node, String indent) public void print(RSEDOMNode node, String indent) {
{
String type = node.getType(); String type = node.getType();
String name = node.getName(); String name = node.getName();
RSEDOMNodeAttribute[] attributes = node.getAttributes(); RSEDOMNodeAttribute[] attributes = node.getAttributes();
RSEDOMNode[] children = node.getChildren(); RSEDOMNode[] children = node.getChildren();
System.out.println(indent + "RSEDOMNode " + type); System.out.println(indent + "RSEDOMNode " + type);
System.out.println(indent + "{"); System.out.println(indent + "{");
String sindent = indent + " "; String sindent = indent + " ";
System.out.println(sindent + "name=" + name); System.out.println(sindent + "name=" + name);
for (int i = 0; i < attributes.length; i++) for (int i = 0; i < attributes.length; i++) {
{
RSEDOMNodeAttribute attribute = attributes[i]; RSEDOMNodeAttribute attribute = attributes[i];
String key = attribute.getKey(); String key = attribute.getKey();
String value = attribute.getValue(); String value = attribute.getValue();
System.out.println(sindent + key + "=" + value); System.out.println(sindent + key + "=" + value);
} }
String cindent = sindent + " "; String cindent = sindent + " ";
for (int c = 0; c < children.length; c++) for (int c = 0; c < children.length; c++) {
{
RSEDOMNode child = children[c]; RSEDOMNode child = children[c];
print(child, cindent); print(child, cindent);
} }