[Ds-java-dev] svn commit r14428 -
trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog
svn at wso2.org
svn at wso2.org
Sun Mar 2 23:26:10 PST 2008
Author: sandakith
Date: Sun Mar 2 23:26:00 2008
New Revision: 14428
Log:
Add Dialog to represent the CSV configuration
Added:
trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/CSVConfigurationDialog.java
Added: trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/CSVConfigurationDialog.java
==============================================================================
--- (empty file)
+++ trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/CSVConfigurationDialog.java Sun Mar 2 23:26:00 2008
@@ -0,0 +1,142 @@
+/*
+ * 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.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 CSV configuration UI
+ */
+public class CSVConfigurationDialog extends Dialog{
+
+ private Text csvFileLocationText;
+ private Text columnSeperationText;
+ private Text startingRowText;
+ private Text maxToReadText;
+ private Combo headerAvailableCombo;
+
+ public CSVConfigurationDialog(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("CSV Configuration");
+ 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("CSV File Location");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ csvFileLocationText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ csvFileLocationText.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Column Speration");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ columnSeperationText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ columnSeperationText.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Starting Row");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ startingRowText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ startingRowText.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Max. Rows to read");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ maxToReadText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ maxToReadText.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Header Available");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ headerAvailableCombo = new Combo(container,SWT.NULL);
+ loadDataSourceCombo();
+ headerAvailableCombo.select(0);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ headerAvailableCombo.setLayoutData(gd);
+
+ label = new Label(container, SWT.NULL);
+ label.setText("");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ return super.createDialogArea(parent);
+ }
+
+ /**
+ * Add the content to the data source combo.
+ */
+ private void loadDataSourceCombo() {
+ headerAvailableCombo.add("TRUE");
+ headerAvailableCombo.add("FALSE");
+ }
+
+}
+
+
More information about the Ds-java-dev
mailing list