[Ds-java-dev] svn commit r14471 - 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 17:28:42 PST 2008


Author: sandakith
Date: Mon Mar  3 17:28:38 2008
New Revision: 14471

Log:

Add Dialog to represent the Add New Output Mapping Dialog UI

Added:
   trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddOutputMappingDialog.java

Added: trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddOutputMappingDialog.java
==============================================================================
--- (empty file)
+++ trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddOutputMappingDialog.java	Mon Mar  3 17:28:38 2008
@@ -0,0 +1,139 @@
+/*
+ * 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 Output Mapping configuration UI
+ */
+public class AddOutputMappingDialog extends Dialog{
+
+	private Combo mappingTypeCombo;
+
+	public AddOutputMappingDialog(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 Output Mapping");
+		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("Mapping Type");
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 1;
+		label.setLayoutData(gd);
+
+		mappingTypeCombo = new Combo(container,SWT.NULL);
+		loadMappingTypeCombo();
+		mappingTypeCombo.select(0);
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 2;
+		mappingTypeCombo.setLayoutData(gd);
+		mappingTypeCombo.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				comboChanged();
+			}
+		});
+
+		label = new Label(container, SWT.NULL);
+		label.setText("Output Field Name");
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 1;
+		label.setLayoutData(gd);
+
+		Text outputFieldNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 2;
+		outputFieldNameText.setLayoutData(gd);
+		outputFieldNameText.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				//pathChanged();
+			}
+		});
+
+		label = new Label(container, SWT.NULL);
+		label.setText("SQL Column Name");
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 1;
+		label.setLayoutData(gd);
+
+		Text sqlColumnNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 2;
+		sqlColumnNameText.setLayoutData(gd);
+		sqlColumnNameText.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				//pathChanged();
+			}
+		});
+
+		return super.createDialogArea(parent);
+	}
+
+	/**
+	 * Add the content to the mapping type combo.
+	 */
+	private void loadMappingTypeCombo() {
+		mappingTypeCombo.add("ELEMENT");
+		mappingTypeCombo.add("QUERY");
+	}
+
+
+	/**
+	 * Ensures that both text fields are set.
+	 */
+	private void comboChanged() {
+		//validate the plug-in
+	}
+
+}
\ No newline at end of file



More information about the Ds-java-dev mailing list