home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.netobjects.nfx.wizard.WizardPage;
- import asp.netobjects.nfx.wizard.WizardPageView;
- import asp.util.ResourceUtil;
- import com.sun.java.swing.AbstractButton;
- import com.sun.java.swing.JButton;
- import com.sun.java.swing.JTextField;
- import com.sun.java.swing.text.JTextComponent;
-
- public class WizardViewDbQuery extends WizardViewAbstract {
- public static final String ERR_EDIT_WARN = "error.edit_warn";
- private static WizardViewAbstract _instance = null;
- private WVPanelDbQuery _mainPanel;
- // $FF: synthetic field
- static Class class$asp$wizard$WVPanelDbQuery;
-
- public static WizardViewAbstract getInstance() {
- if (_instance == null) {
- _instance = new WizardViewDbQuery();
- }
-
- return _instance;
- }
-
- protected void createMainPanel() {
- this._mainPanel = new WVPanelDbQuery();
- JButton btnSql = this._mainPanel._btnBuildSql;
- ((AbstractButton)btnSql).addActionListener(new 1(this));
- JButton btnQuery = this._mainPanel._btnTestQuery;
- ((AbstractButton)btnQuery).addActionListener(new 2(this));
- JButton btnEditSQL = this._mainPanel._btnEditSql;
- ((AbstractButton)btnEditSQL).addActionListener(new 3(this));
- }
-
- public WVPanelBase getMainPanel() {
- return this._mainPanel;
- }
-
- private void showSqlBuilder() {
- ((WizardModelDbQuery)((WizardPageView)this).getModel()).showSqlBuilder();
- }
-
- private void testQuery() {
- ((WizardModelDbQuery)((WizardPageView)this).getModel()).testQuery();
- }
-
- public void updateView(WizardModelAbstract model, Object arg) {
- if (arg == "_subwizfinished_") {
- this._mainPanel.enableStep2Controls(true);
- this._mainPanel.enableStep3Controls(true);
- }
-
- }
-
- public void updateControls(boolean firstTime) {
- if (firstTime) {
- this._mainPanel.enableStep2ControlsTextboxes(false);
- this._mainPanel.enableStep2Controls(false);
- this._mainPanel.enableStep3Controls(false);
- } else {
- this._mainPanel.enableStep2Controls(true);
- this._mainPanel.enableStep3Controls(true);
- this._mainPanel.enableStep2ControlsTextboxes(false);
- }
-
- }
-
- public void setModel(WizardPage model) {
- super.setModel(model);
- }
-
- public void editSQL() {
- String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$WVPanelDbQuery != null ? class$asp$wizard$WVPanelDbQuery : (class$asp$wizard$WVPanelDbQuery = class$("asp.wizard.WVPanelDbQuery")), "error.edit_warn");
- AspWizardExceptionHandler.showMessage(0, err);
- this._mainPanel.enableStep2ControlsTextboxes(true);
- }
-
- private void setTextFieldText(JTextField textField, String text) {
- ((JTextComponent)textField).setText(text);
- textField.setScrollOffset(0);
- }
-
- public void setSelect(String select) {
- this.setTextFieldText(this._mainPanel._txfSelect, select);
- }
-
- public void setFrom(String from) {
- this.setTextFieldText(this._mainPanel._txfFrom, from);
- }
-
- public void setWhere(String where) {
- this.setTextFieldText(this._mainPanel._txfWhere, where);
- }
-
- public void setOrderBy(String orderBy) {
- this.setTextFieldText(this._mainPanel._txfOrderBy, orderBy);
- }
-
- public String getSelect() {
- return this._mainPanel._txfSelect.getText();
- }
-
- public String getFrom() {
- return this._mainPanel._txfFrom.getText();
- }
-
- public String getWhere() {
- return this._mainPanel._txfWhere.getText();
- }
-
- public String getOrderBy() {
- return this._mainPanel._txfOrderBy.getText();
- }
-
- // $FF: synthetic method
- static void access$0(WizardViewDbQuery $0) {
- $0.showSqlBuilder();
- }
-
- // $FF: synthetic method
- static void access$1(WizardViewDbQuery $0) {
- $0.testQuery();
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-