001: /*
002: * The contents of this file are subject to the Mozilla Public License
003: * Version 1.1 (the "License"); you may not use this file except in
004: * compliance with the License. You may obtain a copy of the License at
005: * http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
009: * License for the specific language governing rights and limitations
010: * under the License.
011: *
012: * The Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
013: *
014: * The Initial Developer of the Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
015: * Portions created by Mark A. Kobold are Copyright (C) 2000-2007. All Rights Reserved.
016: *
017: * Contributor(s):
018: * Mark A. Kobold [mkobold <at> isqlviewer <dot> com].
019: *
020: * If you didn't download this code from the following link, you should check
021: * if you aren't using an obsolete version: http://www.isqlviewer.com
022: */
023: package org.isqlviewer.ui.wizards.service;
024:
025: import java.awt.GridBagConstraints;
026: import java.awt.Insets;
027:
028: import org.isqlviewer.ui.wizards.Step;
029: import org.isqlviewer.ui.wizards.Wizard;
030: import org.isqlviewer.ui.wizards.WizardContext;
031: import org.isqlviewer.util.LocalMessages;
032: import org.isqlviewer.util.LoggableObject;
033:
034: /**
035: * @author mkobold
036: */
037: public class ServiceWizard extends LoggableObject implements Wizard {
038:
039: static final String BUNDLE_NAME = "org.isqlviewer.ui.wizards.service.ResourceBundle";
040: static final String ATTRIBUTE_SERVICE = "org.isqlviewer.service";
041: static final String ATTRIBUTE_SERVICE_REFERENCE = "org.isqlviewer.service-reference";
042: static final String ATTRIBUTE_FUNCTION = "org.isqlviewer.service-function";
043: static final String ATTRIBUTE_PROPERTIES = "org.isqlviewer.service-properties";
044:
045: private static final Insets INSETS = new Insets(1, 1, 1, 1);
046: private static final GridBagConstraints UI_CONSTRAINT = new GridBagConstraints(
047: 0, 0, 0, 0, 0, 0, 0, 0, INSETS, 0, 0);
048: private LocalMessages messages = new LocalMessages(BUNDLE_NAME);
049: private Step firstStep = null;
050:
051: static final String FUNCTION_MODIFY = "modify";
052: static final String FUNCTION_DELETE = "delete";
053: static final String FUNCTION_CREATE = "new";
054: static final String FUNCTION_IMPORT = "import";
055:
056: public void init(WizardContext wizardContext) {
057:
058: firstStep = new SelectServiceFunctionStep();
059: firstStep.init(wizardContext);
060: }
061:
062: public boolean supportsHome() {
063:
064: return false;
065: }
066:
067: public void cancel(WizardContext wizardContext) {
068:
069: info("cancelling new service wizard...");
070:
071: }
072:
073: public void destroy(WizardContext wizardContext) {
074:
075: info("destroying new service wizard...");
076:
077: }
078:
079: public void finish(WizardContext wizardContext) {
080:
081: info("finishing new service wizard...");
082: }
083:
084: public String getTitle() {
085:
086: return messages.getMessage("newservicewizard.main_title");
087: }
088:
089: public Step firstStep() {
090:
091: return firstStep;
092: }
093:
094: protected static GridBagConstraints constrain(int x, int y, int w,
095: int h, double wx, double wy, int a, int f) {
096:
097: UI_CONSTRAINT.gridx = x;
098: UI_CONSTRAINT.gridy = y;
099: UI_CONSTRAINT.gridwidth = w;
100: UI_CONSTRAINT.gridheight = h;
101: UI_CONSTRAINT.weightx = wx;
102: UI_CONSTRAINT.weighty = wy;
103: UI_CONSTRAINT.anchor = a;
104: UI_CONSTRAINT.fill = f;
105: return UI_CONSTRAINT;
106: }
107: }
|