[Ds-java-dev] svn commit r14461 -
trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog
svn at wso2.org
svn at wso2.org
Mon Mar 3 08:12:34 PST 2008
Author: sandakith
Date: Mon Mar 3 08:12:30 2008
New Revision: 14461
Log:
Add Dialog to represent the Add New Input Parameter Dialog UI
Added:
trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddInputParamDialog.java
Added: trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddInputParamDialog.java
==============================================================================
--- (empty file)
+++ trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddInputParamDialog.java Mon Mar 3 08:12:30 2008
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://www.wso2.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.wso2.ws.dataservice.ide.dialog;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Dialog represent the Add Input Parameter configuration UI
+ */
+public class AddInputParamDialog extends Dialog{
+
+ private Combo sqlTypeCombo;
+ private Combo inOutTypeCombo;
+
+ public AddInputParamDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ /**
+ * Create the dialog area with the controls
+ */
+ protected Control createDialogArea(final Composite parent) {
+ Composite container = (Composite) super.createDialogArea(parent);
+
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 10;
+
+ Label label = new Label(container, SWT.NULL);
+ label.setText("Add New Input Param");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ label.setLayoutData(gd);
+
+ label = new Label(container, SWT.HORIZONTAL | SWT.SEPARATOR);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ label.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ label.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Name");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ nameText.setLayoutData(gd);
+ nameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ pathChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText("SQL Type");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ sqlTypeCombo = new Combo(container,SWT.NULL);
+ loadSQLTypeCombo();
+ sqlTypeCombo.select(0);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ sqlTypeCombo.setLayoutData(gd);
+ sqlTypeCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ comboChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText("In/Out Type");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ inOutTypeCombo = new Combo(container,SWT.NULL);
+ loadInOutTypeCombo();
+ inOutTypeCombo.select(0);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ inOutTypeCombo.setLayoutData(gd);
+ inOutTypeCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ comboChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Ordinal");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ Text ordinalText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ ordinalText.setLayoutData(gd);
+ ordinalText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ pathChanged();
+ }
+ });
+
+ return super.createDialogArea(parent);
+ }
+
+ private void pathChanged() {
+ //update the data model
+ }
+
+ /**
+ * Add the content to the sql type combo.
+ */
+ private void loadSQLTypeCombo() {
+ sqlTypeCombo.add("STRING");
+ sqlTypeCombo.add("INTEGER");
+ sqlTypeCombo.add("DOUBLE");
+ sqlTypeCombo.add("DATE");
+ sqlTypeCombo.add("TIME");
+ sqlTypeCombo.add("TIMESTAMP");
+ }
+
+ /**
+ * Add the content to the in/out type combo.
+ */
+ private void loadInOutTypeCombo() {
+ inOutTypeCombo.add("IN");
+ inOutTypeCombo.add("OUT");
+ inOutTypeCombo.add("IN/OUT");
+ }
+
+ /**
+ * Handle the Combo Changed scenario
+ */
+ private void comboChanged() {
+ //Combo updated
+ }
+
+}
+
+
More information about the Ds-java-dev
mailing list