Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@96226 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-28 17:17:11 +00:00
parent 4a3d8765fc
commit 759b507a58
3 changed files with 78 additions and 18 deletions

View File

@ -3898,3 +3898,35 @@ Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
50% complete (ETR: 3 seconds)
50% complete (ETR: 3 seconds)
50% complete (ETR: 3 seconds)
50% complete (ETR: 3 seconds)
50% complete (ETR: 3 seconds)
50% complete (ETR: 3 seconds)
60% complete (ETR: 3 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 12.41 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -3,12 +3,12 @@ package org.gcube.portlets.user.td.columnwidget.client.create;
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TableType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* Edit Row
*
@ -17,16 +17,18 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*/
public class CreateDefColumnDialog extends Window {
protected String WIDTH = "460px";
protected String HEIGHT = "320px";
protected String HEIGHT = "220px";
protected EventBus eventBus;
protected CreateDefColumnPanel createDefColumnPanel;
protected TableType tableType;
public CreateDefColumnDialog(String id, TableType tableType,EventBus eventBus) {
public CreateDefColumnDialog(String id, TableType tableType,
EventBus eventBus) {
this.eventBus = eventBus;
this.tableType = tableType;
initWindow();
createDefColumnPanel = new CreateDefColumnPanel(this,id,tableType, eventBus);
createDefColumnPanel = new CreateDefColumnPanel(this, id, tableType,
eventBus);
add(createDefColumnPanel);
}
@ -35,7 +37,7 @@ public class CreateDefColumnDialog extends Window {
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setClosable(true);
setModal(true);
forceLayoutOnResize = true;
@ -63,15 +65,25 @@ public class CreateDefColumnDialog extends Window {
hide();
}
public void addListener(CreateDefColumnListener listener) {
createDefColumnPanel.addListener(listener);
Log.debug("Add Listener" + listener);
if (createDefColumnPanel != null) {
createDefColumnPanel.addListener(listener);
} else {
Log.error("CreateDefColumnPanel is null");
}
}
public void removeListener(CreateDefColumnListener listener) {
createDefColumnPanel.removeListener(listener);
Log.debug("Remove Listener" + listener);
if (createDefColumnPanel != null) {
createDefColumnPanel.removeListener(listener);
} else {
Log.error("CreateDefColumnPanel is null");
}
}
}

View File

@ -53,10 +53,10 @@ import com.sencha.gxt.widget.core.client.info.Info;
*
*/
public class CreateDefColumnPanel extends FramedPanel {
protected static final String WIDTH = "460px";
protected static final String HEIGHT = "320px";
protected static final String FIELDWIDTH = "440px";
protected static final String FIELDSHEIGHT = "300px";
protected static final String WIDTH = "448px";
protected static final String HEIGHT = "180px";
protected static final String FIELDWIDTH = "436px";
protected static final String FIELDSHEIGHT = "130px";
protected ArrayList<CreateDefColumnListener> listeners;
@ -91,17 +91,22 @@ public class CreateDefColumnPanel extends FramedPanel {
this.eventBus = eventBus;
this.tableType = tableType;
this.id = id;
initListeners();
init();
create();
}
protected void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
setHeaderVisible(false);
setBodyBorder(false);
}
protected void initListeners(){
listeners=new ArrayList<CreateDefColumnListener>();
}
protected void create() {
// Label
label = new TextField();
@ -235,6 +240,8 @@ public class CreateDefColumnPanel extends FramedPanel {
vPanel.add(form, new VerticalLayoutData(1, -1));
vPanel.add(flowButton, new VerticalLayoutData(1, -1, new Margins(1)));
add(vPanel);
comboLocaleTypeLabel.setVisible(false);
}
@ -250,13 +257,16 @@ public class CreateDefColumnPanel extends FramedPanel {
if (lab == null || lab.isEmpty()) {
UtilsGXT3.alert("Attention", "Add a label");
return;
}
if (typeElement == null) {
UtilsGXT3.alert("Attention", "No type selected");
return;
} else {
if (typeElement.getCode() == null) {
UtilsGXT3.alert("Attention", "No type selected");
return;
} else {
currentType = typeElement.getCode();
}
@ -264,10 +274,12 @@ public class CreateDefColumnPanel extends FramedPanel {
if (currentType != null && currentType == ColumnTypeCode.CODENAME) {
if (localeElement == null) {
UtilsGXT3.alert("Attention", "No locale selected");
return;
} else {
if (localeElement.getLocaleName() == null
|| localeElement.getLocaleName().isEmpty()) {
UtilsGXT3.alert("Attention", "No locale selected");
return;
} else {
localeName = localeElement.getLocaleName();
}
@ -336,9 +348,11 @@ public class CreateDefColumnPanel extends FramedPanel {
switch (type) {
case CODENAME:
comboLocaleTypeLabel.setVisible(true);
forceLayout();
break;
default:
comboLocaleTypeLabel.setVisible(false);
forceLayout();
break;
}
}
@ -381,10 +395,12 @@ public class CreateDefColumnPanel extends FramedPanel {
}
public void addListener(CreateDefColumnListener listener) {
Log.debug("Add Listener:"+listener);
listeners.add(listener);
}
public void removeListener(CreateDefColumnListener listener) {
Log.debug("Remove Listener:"+listener);
listeners.remove(listener);
}