form "SubmitQuery" improved inserting the textArea component for the query

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98635 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-07-15 09:43:43 +00:00
parent 4882ab9bcf
commit f69a2d5a32
3 changed files with 38 additions and 13 deletions

View File

@ -9,16 +9,22 @@ import org.gcube.portlets.user.databasesmanager.client.datamodel.SubmitQueryData
//import org.gcube.portlets.user.dbmanager.client.datamodel.SubmitQueryData;
import com.extjs.gxt.charts.client.model.Legend.Position;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
public class GxtFormSubmitQuery extends LayoutContainer {
private VerticalPanel vp;
// private VerticalPanel vp;
FormPanel form;
private FormData formData;
@ -32,15 +38,21 @@ public class GxtFormSubmitQuery extends LayoutContainer {
public GxtFormSubmitQuery() {
// this.setLayout(new RowLayout(Orientation.HORIZONTAL));
this.setLayout(new FitLayout());
// this.setSize(600, 400);
formData = new FormData("-20");
vp = new VerticalPanel();
// vp = new VerticalPanel();
vp.setSpacing(10);
// vp.setSpacing(10);
createLayout();
add(vp);
// add(vp);
}
@ -52,15 +64,23 @@ public class GxtFormSubmitQuery extends LayoutContainer {
// form.setHeading("Submit Query");
form.setHeaderVisible(false);
form.setFrame(true);
form.setWidth(250);
// form.setFrame(true);
// form.setWidth(350);
// form.setWidth(350);
// form.setHeight(250);
// Query field
TextField<String> query = new TextField<String>();
// TextField<String> query = new TextField<String>();
// query.setFieldLabel("Query");
TextArea query = new TextArea();
query.setHeight(300);
query.setPreventScrollbars(false);
query.setFieldLabel("Query");
// query.setHeight(50);
// query.setWidth(50);
// query.setAllowBlank(false);
@ -85,6 +105,7 @@ public class GxtFormSubmitQuery extends LayoutContainer {
CheckBox checkSC = new CheckBox();
checkSC.setFieldLabel("Apply Smart Corrections");
checkSC.setValue(true);
// smartCorrection.add(checkSC);
// form.add(smartCorrection, formData);
form.add(checkSC, formData);
@ -106,13 +127,15 @@ public class GxtFormSubmitQuery extends LayoutContainer {
// combo.setStore(store);
// form.add(combo, formData);
vp.add(form);
// vp.add(form);
this.add(form);
}
private String getQuery() {
String query = ((TextField<String>) form.getWidget(0)).getValue();
String query = ((TextArea) form.getWidget(0)).getValue();
// System.out.println("GxtFormSubmitQuery->query: " + query);

View File

@ -10,7 +10,6 @@ import java.util.logging.Logger;
import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerServiceAsync;
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
import org.gcube.portlets.user.databasesmanager.client.events.LoadTablesEvent;
import org.gcube.portlets.user.databasesmanager.client.events.SelectedItemEvent;
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
@ -74,7 +73,7 @@ public class GxtTreePanel extends LayoutContainer {
store = new TreeStore<FileModel>();
//remove the scroll mode.
//remove the scroll mode (the scroll of the panel that contains the tree is used)
this.setScrollMode(Scroll.NONE);
this.initLayout();

View File

@ -190,9 +190,12 @@ public class GxtToolbarFunctionality {
// dialog.setPlain(true);
// dialog.setCollapsible(false);
dialog.setResizable(false);
dialog.setMaximizable(true);
dialog.setHeading("Submit Query");
dialog.setWidth(290);
dialog.setHeight(250);
dialog.setSize(600, 500);
// dialog.setWidth(290);
// dialog.setHeight(250);
final GxtFormSubmitQuery form = new GxtFormSubmitQuery();