code cleaned up removing commented lines in class GxtFormSubmitQuery and in packages interfaces, events, datamodel, client

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@99119 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-07-30 15:36:09 +00:00
parent f90b8a4e71
commit 4c457cfd7e
20 changed files with 11 additions and 167 deletions

View File

@ -105,5 +105,4 @@ public class DatabasesManager implements EntryPoint {
borderLayout.setWidth(rootWidth);
}
}

View File

@ -14,7 +14,6 @@ public class ComputationOutput {
public void setMapValues(LinkedHashMap<String, String> mapValues) {
this.mapValues = mapValues;
}
public void setmapKeys(LinkedHashMap<String, String> mapKeys) {
@ -22,13 +21,10 @@ public class ComputationOutput {
}
public LinkedHashMap<String, String> getMapValues() {
return mapValues;
}
public LinkedHashMap<String, String> getmapKeys() {
return mapKeys;
}
}

View File

@ -14,7 +14,6 @@ public class FileModel extends BaseModelData implements Serializable {
private static int ID = 1;
// private int id;
private boolean isExpanded = true;
// set to true value if the object has been managed calling rpc remote
// methods
private boolean isLoaded = false;
@ -26,7 +25,6 @@ public class FileModel extends BaseModelData implements Serializable {
private boolean isDatabase = false;
// set if the node in the tree is collapsed
private boolean isCollapsed = false;
// to keep track information about the database
private List<Result> DBInfo = null;
// set if database information are displayed
@ -37,7 +35,7 @@ public class FileModel extends BaseModelData implements Serializable {
private boolean isTableDetailsDisplayed = false;
// to keep track of the database type
private String DatabaseType = null;
// resource data
private String ResourceName = null;
private String DatabaseName = null;
@ -50,15 +48,13 @@ public class FileModel extends BaseModelData implements Serializable {
public FileModel(String name) {
setName(name);
setId();
}
//constructor for the root element in the tree
public FileModel(String name, int id) {
setName(name);
set("ID", id);
}
// constructor for the root element in the tree
public FileModel(String name, int id) {
setName(name);
set("ID", id);
}
public void setId() {
set("ID", ID++);
@ -66,7 +62,6 @@ public class FileModel extends BaseModelData implements Serializable {
public int getId() {
return get("ID");
}
public void setName(String name) {
@ -78,30 +73,23 @@ public class FileModel extends BaseModelData implements Serializable {
}
public void setIsExpanded(boolean value) {
isExpanded = value;
}
public boolean isExpanded() {
return isExpanded;
}
public void setIsLoaded(boolean value) {
isLoaded = value;
}
public boolean isLoaded() {
return isLoaded;
}
// // set if the object is a schema
// public void setIsSchema(boolean value) {
//
// set("isSchema", value);
// }
//
@ -111,49 +99,40 @@ public class FileModel extends BaseModelData implements Serializable {
// set if the object is a schema
public void setIsSchema(boolean value) {
// set("isSchema", value);
isSchema = value;
}
public boolean isSchema() {
// return get("isSchema");
return isSchema;
}
// // set if the object is a table
// public void setIsTable(boolean value) {
//
// set("isTable", value);
// }
//
// public boolean isTable() {
//
// return get("isTable");
// }
// set if the object is a table
public void setIsTable(boolean value) {
// set("isTable", value);
isTable = value;
}
public boolean isTable() {
// return get("isTable");
return isTable;
}
public void setIsDatabase(boolean value) {
isDatabase = value;
}
public boolean isDatabase() {
return isDatabase;
}
@ -190,41 +169,33 @@ public class FileModel extends BaseModelData implements Serializable {
}
public void setDatabaseType(String value) {
DatabaseType = value;
}
public String getDatabaseType() {
return this.DatabaseType;
}
public void setResourceName(String value) {
ResourceName = value;
}
public String getResourceName() {
return ResourceName;
}
public void setDatabaseName(String value) {
DatabaseName = value;
}
public String getDatabaseName() {
return DatabaseName;
}
public void setIsCollapsed(boolean value) {
isCollapsed = true;
}
public boolean getIsCollapsed() {
return isCollapsed;
}
@ -237,5 +208,4 @@ public class FileModel extends BaseModelData implements Serializable {
}
return super.equals(obj);
}
}

View File

@ -13,16 +13,13 @@ public class Parameter implements Serializable {
public Parameter(String paramName, String paramDescription,
String objectType, String defaultValue) {
this.setName(paramName);
this.setParamDescription(paramDescription);
this.setObjectType(objectType);
this.setDefaultValue(defaultValue);
}
public Parameter() {
// TODO Auto-generated constructor stub
}
public String getValue() {
@ -50,23 +47,18 @@ public class Parameter implements Serializable {
}
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public String getObjectType() {
return objectType;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getDefaultValue() {
return defaultValue;
}
}

View File

@ -17,7 +17,6 @@ public class Result extends BaseModelData implements Serializable {
public Result(String index, String value) {
set("index", index);
set("value", value);
}
public String getValue() {
@ -27,5 +26,4 @@ public class Result extends BaseModelData implements Serializable {
public String getIndex() {
return get("index");
}
}

View File

@ -11,21 +11,15 @@ public class Row extends BaseModelData implements Serializable {
private static final long serialVersionUID = 1L;
// private static int ID = 0;
// private static Logger rootLogger = Logger.getLogger("Row");
public Row() {
}
public Row(List<String> attributes, List<String> values, int index) {
set("index", index);
for (int i = 0; i < attributes.size(); i++) {
set(attributes.get(i), values.get(i));
// print check
// System.out.println("attribute: " + attributes.get(i) + " value: "
// + values.get(i));
@ -33,9 +27,7 @@ public class Row extends BaseModelData implements Serializable {
// print check
// rootLogger.log(Level.INFO, "Row-> attribute: "
// +attributes.get(i)+ "value: " + values.get(i));
}
}
public String getValue(String attribute) {
@ -89,5 +81,4 @@ public class Row extends BaseModelData implements Serializable {
//
// return elements;
// }
}

View File

@ -15,7 +15,6 @@ public class SQLDialect extends BaseModelData {
}
public SQLDialect(String name) {
setName(name);
}
@ -24,12 +23,10 @@ public class SQLDialect extends BaseModelData {
}
public String getName() {
return get("name");
}
public static List<SQLDialect> loadData() {
List<SQLDialect> dialects = new ArrayList<SQLDialect>();
SQLDialect element1 = new SQLDialect(ConstantsPortlet.NONE);
@ -41,7 +38,5 @@ public class SQLDialect extends BaseModelData {
dialects.add(element3);
return dialects;
}
}

View File

@ -5,11 +5,10 @@ public class SubmitQueryData {
private String query;
private boolean readOnlyQuery;
private boolean smartCorrection;
//the dialect information
// the dialect information
private String language;
public SubmitQueryData(){
public SubmitQueryData() {
}
public void setQuery(String value) {
@ -43,5 +42,4 @@ public class SubmitQueryData {
public String getLanguage() {
return this.language;
}
}

View File

@ -9,22 +9,15 @@ public class LoadTablesEvent extends GwtEvent<LoadTablesEventHandler> {
@Override
protected void dispatch(LoadTablesEventHandler handler) {
// TODO Auto-generated method stub
handler.onLoadTables(this);
}
@Override
public Type<LoadTablesEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.LOAD_TABLES_EVENT;
}
}

View File

@ -9,22 +9,15 @@ public class RandomSamplingEvent extends GwtEvent<RandomSamplingEventHandler> {
@Override
protected void dispatch(RandomSamplingEventHandler handler) {
// TODO Auto-generated method stub
handler.onRandomSampling(this);
}
@Override
public Type<RandomSamplingEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.RANDOM_SAMPLING_EVENT;
}
}

View File

@ -9,22 +9,15 @@ public class SamplingEvent extends GwtEvent<SamplingEventHandler> {
@Override
public Type<SamplingEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(SamplingEventHandler handler) {
// TODO Auto-generated method stub
handler.onSampling(this);
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SAMPLING_EVENT;
}
}

View File

@ -9,22 +9,15 @@ public class SelectedItemEvent extends GwtEvent<SelectedItemEventHandler> {
@Override
public Type<SelectedItemEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(SelectedItemEventHandler handler) {
// TODO Auto-generated method stub
handler.onSelectedItem(this);
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SELECTED_ITEM_EVENT;
}
}

View File

@ -9,22 +9,15 @@ public class SelectedTableEvent extends GwtEvent<SelectedTableEventHandler> {
@Override
public Type<SelectedTableEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(SelectedTableEventHandler handler) {
// TODO Auto-generated method stub
handler.onSelectedTable(this);
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SELECTED_TABLE_EVENT;
}
}

View File

@ -9,22 +9,15 @@ public class ShowCreateTableEvent extends GwtEvent<ShowCreateTableEventHandler>
@Override
protected void dispatch(ShowCreateTableEventHandler handler) {
// TODO Auto-generated method stub
handler.onShowCreateTable(this);
}
@Override
public Type<ShowCreateTableEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SHOW_CREATE_TABLE_EVENT;
}
}

View File

@ -9,22 +9,15 @@ public class SmartSamplingEvent extends GwtEvent<SmartSamplingEventHandler> {
@Override
protected void dispatch(SmartSamplingEventHandler handler) {
// TODO Auto-generated method stub
handler.onSmartSampling(this);
}
@Override
public Type<SmartSamplingEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SMART_SAMPLING_EVENT;
}
}

View File

@ -14,26 +14,19 @@ public class SubmitQueryEvent extends GwtEvent<SubmitQueryEventHandler> {
@Override
public Type<SubmitQueryEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(SubmitQueryEventHandler handler) {
// TODO Auto-generated method stub
handler.onSubmitQuery(this);
}
public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SUBMIT_QUERY_EVENT;
}
public int getDialogID(){
return dialogID;
}
}

View File

@ -4,7 +4,5 @@ import org.gcube.portlets.user.databasesmanager.client.events.RandomSamplingEven
import com.google.gwt.event.shared.EventHandler;
public interface RandomSamplingEventHandler extends EventHandler {
public void onRandomSampling(RandomSamplingEvent randomSamplingEvent);
}

View File

@ -4,7 +4,5 @@ import org.gcube.portlets.user.databasesmanager.client.events.SelectedTableEvent
import com.google.gwt.event.shared.EventHandler;
public interface SelectedTableEventHandler extends EventHandler {
public void onSelectedTable(SelectedTableEvent selectedTableEvent);
}

View File

@ -4,7 +4,5 @@ import org.gcube.portlets.user.databasesmanager.client.events.SmartSamplingEvent
import com.google.gwt.event.shared.EventHandler;
public interface SmartSamplingEventHandler extends EventHandler {
public void onSmartSampling(SmartSamplingEvent smartSamplingEvent);
}

View File

@ -13,36 +13,29 @@ import com.extjs.gxt.ui.client.widget.layout.FormData;
//Form that the is used from the user to insert data useful for submit a query
public class GxtFormSubmitQuery extends LayoutContainer {
// private VerticalPanel vp;
private FormPanel form;
private FormData formData;
// gwt logger
// GWT logger
private static Logger rootLogger = Logger.getLogger("GxtFormSubmitQuery");
public GxtFormSubmitQuery() {
this.setLayout(new FitLayout());
// this.setSize(600, 400);
formData = new FormData("-20");
// vp = new VerticalPanel();
// vp.setSpacing(10);
createLayout();
// add(vp);
}
private void createLayout() {
form = new FormPanel();
// form.setHeading("Submit Query");
form.setHeaderVisible(false);
// form.setFrame(true);
// form.setWidth(350);
// form.setWidth(350);
// form.setHeight(250);
@ -52,7 +45,6 @@ public class GxtFormSubmitQuery extends LayoutContainer {
query.setHeight(300);
query.setPreventScrollbars(false);
query.setFieldLabel("Query");
// query.setHeight(50);
// query.setWidth(50);
// query.setAllowBlank(false);
@ -100,75 +92,50 @@ public class GxtFormSubmitQuery extends LayoutContainer {
// vp.add(form);
this.add(form);
}
// get the query
private String getQuery() {
String query = ((TextArea) form.getWidget(0)).getValue();
// print check
// System.out.println("GxtFormSubmitQuery->query: " + query);
rootLogger.log(Level.SEVERE, "query: " + query);
return query;
}
// get the smart correction value
private boolean getSmartCorrectionValue() {
// CheckBox checkSC = ((CheckBox) form.getWidget(2));
CheckBox checkSC = ((CheckBox) form.getWidget(1));
// print check
// System.out.println("GxtFormSubmitQuery->smartcorrection: "
// + checkSC.getValue());
rootLogger.log(Level.SEVERE, "smartcorrection: " + checkSC.getValue());
return (checkSC.getValue());
}
// get data for submit a query
public SubmitQueryData getSubmitQueryData() {
layout(true);
SubmitQueryData data = new SubmitQueryData();
data.setQuery(this.getQuery());
// TO REMOVE
// data.setReadOnlyQuery(this.getReadOnlyQueryValue());
data.setSmartCorrection(this.getSmartCorrectionValue());
// TO REMOVE
// data.setLanguage(this.getLanguage());
return data;
}
// private String getLanguage() {
//
// ComboBox<SQLDialect> combo = ((ComboBox<SQLDialect>) form.getWidget(3));
// SQLDialect item = combo.getValue();
//
// System.out.println("GxtFormSubmitQuery->language: " + item.getName());
//
// return item.getName();
// }
// private boolean getReadOnlyQueryValue() {
//
// CheckBox checkRO = ((CheckBox) form.getWidget(1));
//
// System.out.println("GxtFormSubmitQuery->readonlyquery: "
// + checkRO.getValue());
// return (checkRO.getValue());
//
// }
}