|
From: <tr...@us...> - 2003-08-13 23:37:12
|
Update of /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/config
In directory sc8-pr-cvs1:/tmp/cvs-serv651/gui/src/com/babeldoc/gui/config
Modified Files:
BooleanConfigOptionComponent.java
ComplexConfigOptionComponent.java
MultiLineConfigOptionComponent.java
StringConfigOptionComponent.java
ValueListConfigOptionComponent.java
Log Message:
Config options can now validate and check the mutability flag for setting the value. GUI components now catch the Mutable Exception.
Index: BooleanConfigOptionComponent.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/config/BooleanConfigOptionComponent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BooleanConfigOptionComponent.java 27 Jun 2003 00:14:55 -0000 1.5
--- BooleanConfigOptionComponent.java 13 Aug 2003 22:53:26 -0000 1.6
***************
*** 68,71 ****
--- 68,72 ----
import com.babeldoc.core.option.BooleanConfigOptionType;
import com.babeldoc.core.option.ConfigOption;
+ import com.babeldoc.core.option.MutableConfigValueException;
import java.awt.event.ActionEvent;
***************
*** 125,129 ****
public void focusLost(FocusEvent e) {
boolean selected = ((JCheckBox) getComponent()).isSelected();
! getOption().setValue(Boolean.toString(selected));
}
});
--- 126,134 ----
public void focusLost(FocusEvent e) {
boolean selected = ((JCheckBox) getComponent()).isSelected();
! try {
! getOption().setValue(Boolean.toString(selected));
! } catch (MutableConfigValueException e1) {
! e1.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
}
});
Index: ComplexConfigOptionComponent.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/config/ComplexConfigOptionComponent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ComplexConfigOptionComponent.java 12 Jun 2003 04:51:25 -0000 1.5
--- ComplexConfigOptionComponent.java 13 Aug 2003 22:53:26 -0000 1.6
***************
*** 69,72 ****
--- 69,73 ----
import com.babeldoc.core.option.ConfigOption;
import com.babeldoc.core.option.IConfigOptionType;
+ import com.babeldoc.core.option.MutableConfigValueException;
import java.awt.*;
***************
*** 372,376 ****
} while ((config == null) || (config.length() == 0));
! getActionOption().setValue(config);
tree.revalidate();
}
--- 373,381 ----
} while ((config == null) || (config.length() == 0));
! try {
! getActionOption().setValue(config);
! } catch (MutableConfigValueException e1) {
! e1.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
tree.revalidate();
}
Index: MultiLineConfigOptionComponent.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/config/MultiLineConfigOptionComponent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** MultiLineConfigOptionComponent.java 27 Jun 2003 00:14:55 -0000 1.5
--- MultiLineConfigOptionComponent.java 13 Aug 2003 22:53:26 -0000 1.6
***************
*** 67,70 ****
--- 67,71 ----
import com.babeldoc.core.option.ConfigOption;
+ import com.babeldoc.core.option.MutableConfigValueException;
import java.awt.*;
***************
*** 113,117 ****
}
public void focusLost(FocusEvent e) {
! getOption().setValue(((JTextComponent)getComponent()).getText());
}
});
--- 114,122 ----
}
public void focusLost(FocusEvent e) {
! try {
! getOption().setValue(((JTextComponent)getComponent()).getText());
! } catch (MutableConfigValueException e1) {
! e1.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
}
});
Index: StringConfigOptionComponent.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/config/StringConfigOptionComponent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** StringConfigOptionComponent.java 27 Jun 2003 00:14:55 -0000 1.5
--- StringConfigOptionComponent.java 13 Aug 2003 22:53:26 -0000 1.6
***************
*** 67,70 ****
--- 67,71 ----
import com.babeldoc.core.option.ConfigOption;
+ import com.babeldoc.core.option.MutableConfigValueException;
import java.awt.*;
***************
*** 130,134 ****
}
public void focusLost(FocusEvent e) {
! getOption().setValue(((JTextComponent)getComponent()).getText());
}
});
--- 131,139 ----
}
public void focusLost(FocusEvent e) {
! try {
! getOption().setValue(((JTextComponent)getComponent()).getText());
! } catch (MutableConfigValueException e1) {
! e1.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
}
});
Index: ValueListConfigOptionComponent.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/config/ValueListConfigOptionComponent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ValueListConfigOptionComponent.java 27 Jun 2003 00:14:55 -0000 1.5
--- ValueListConfigOptionComponent.java 13 Aug 2003 22:53:26 -0000 1.6
***************
*** 68,71 ****
--- 68,72 ----
import com.babeldoc.core.option.ConfigOption;
import com.babeldoc.core.option.ValueListConfigOptionType;
+ import com.babeldoc.core.option.MutableConfigValueException;
import java.awt.*;
***************
*** 75,79 ****
import javax.swing.*;
- import javax.swing.text.JTextComponent;
--- 76,79 ----
***************
*** 132,136 ****
public void focusLost(FocusEvent e) {
! getOption().setValue(((JComboBox)getComponent()).getSelectedItem());
}
});
--- 132,140 ----
public void focusLost(FocusEvent e) {
! try {
! getOption().setValue(((JComboBox)getComponent()).getSelectedItem());
! } catch (MutableConfigValueException e1) {
! e1.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
}
});
|