[Ds-java-dev] svn commit r14454 -
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 06:15:47 PST 2008
Author: sandakith
Date: Mon Mar 3 06:15:44 2008
New Revision: 14454
Log:
Add Dialog to represent the Add Operation UI
Added:
trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddOperationDialog.java
Added: trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddOperationDialog.java
==============================================================================
--- (empty file)
+++ trunk/solutions/data-services/java/modules/ide/src/org/wso2/ws/dataservice/ide/dialog/AddOperationDialog.java Mon Mar 3 06:15:44 2008
@@ -0,0 +1,114 @@
+/*
+ * 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;
+
+public class AddOperationDialog extends Dialog{
+
+ private Combo queryTypeCombo;
+
+ /**
+ * Dialog represent the Add Operations configuration UI
+ */
+ public AddOperationDialog(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("Operation Name");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ Text operationNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ operationNameText.setLayoutData(gd);
+ operationNameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ operationNameChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText("Query");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+
+ queryTypeCombo = new Combo(container,SWT.NULL);
+ loadQueryCombo();
+ queryTypeCombo.select(0);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ queryTypeCombo.setLayoutData(gd);
+ queryTypeCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ comboChanged();
+ }
+ });
+
+ return super.createDialogArea(parent);
+ }
+
+ /**
+ * Handle the Operation Name Changed
+ */
+ private void operationNameChanged() {
+ //update the data model
+ }
+
+ /**
+ * Add the content to the query combo
+ */
+ private void loadQueryCombo() {
+ //Load the query details
+ queryTypeCombo.add("");
+ }
+
+ /**
+ * Handle the Query Changed
+ */
+ private void comboChanged() {
+ //handle query change
+ }
+
+}
+
+
More information about the Ds-java-dev
mailing list