mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 23:25:26 +02:00
bug 153253 - formatting to facilitate debug
This commit is contained in:
parent
59801af006
commit
ef8791b9f2
1 changed files with 29 additions and 50 deletions
|
@ -22,113 +22,92 @@ import org.eclipse.rse.model.ISystemProfile;
|
|||
* This class is the root node of an RSE DOM. Each
|
||||
* 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 boolean _saveScheduled = false;
|
||||
private transient ISystemProfile _profile;
|
||||
|
||||
public RSEDOM(ISystemProfile profile)
|
||||
{
|
||||
|
||||
public RSEDOM(ISystemProfile profile) {
|
||||
super(null, TYPE_PROFILE, profile.getName());
|
||||
_profile = profile;
|
||||
}
|
||||
|
||||
public RSEDOM(String profileName)
|
||||
{
|
||||
|
||||
public RSEDOM(String profileName) {
|
||||
super(null, TYPE_PROFILE, profileName);
|
||||
_profile = null;
|
||||
}
|
||||
|
||||
public ISystemProfile getProfile()
|
||||
{
|
||||
|
||||
public ISystemProfile getProfile() {
|
||||
return _profile;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicate that this DOM needs to be saved
|
||||
*/
|
||||
public void markForSave()
|
||||
{
|
||||
if (!restoring && !_needsSave)
|
||||
{
|
||||
//System.out.println("RSEDOM "+getName() + " needs saving");
|
||||
public void markForSave() {
|
||||
if (!restoring && !_needsSave) {
|
||||
_needsSave = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicate that this DOM has been saved
|
||||
*
|
||||
*/
|
||||
public void markUpdated()
|
||||
{
|
||||
if (_needsSave)
|
||||
{
|
||||
//System.out.println("RSEDOM "+getName() + " is up to date");
|
||||
|
||||
public void markUpdated() {
|
||||
if (_needsSave) {
|
||||
_needsSave = false;
|
||||
_saveScheduled = false;
|
||||
super.markUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this DOM is scheduled to be saved
|
||||
* @return
|
||||
* @return true if this DOM is scheduled to be saved
|
||||
*/
|
||||
public boolean saveScheduled()
|
||||
{
|
||||
public boolean saveScheduled() {
|
||||
return _saveScheduled;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicate that this DOM is scheduled to be saved
|
||||
*/
|
||||
public void markSaveScheduled()
|
||||
{
|
||||
if (!_saveScheduled)
|
||||
{
|
||||
public void markSaveScheduled() {
|
||||
if (!_saveScheduled) {
|
||||
_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;
|
||||
}
|
||||
|
||||
public void print(RSEDOMNode node, String indent)
|
||||
{
|
||||
public void print(RSEDOMNode node, String indent) {
|
||||
String type = node.getType();
|
||||
String name = node.getName();
|
||||
RSEDOMNodeAttribute[] attributes = node.getAttributes();
|
||||
RSEDOMNode[] children = node.getChildren();
|
||||
|
||||
|
||||
System.out.println(indent + "RSEDOMNode " + type);
|
||||
System.out.println(indent + "{");
|
||||
String sindent = indent + " ";
|
||||
|
||||
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];
|
||||
String key = attribute.getKey();
|
||||
String value = attribute.getValue();
|
||||
System.out.println(sindent + key + "=" + value);
|
||||
}
|
||||
|
||||
|
||||
String cindent = sindent + " ";
|
||||
for (int c = 0; c < children.length; c++)
|
||||
{
|
||||
for (int c = 0; c < children.length; c++) {
|
||||
RSEDOMNode child = children[c];
|
||||
print(child, cindent);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue