Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@90888 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5f789b7405
commit
eeaa3b2c4c
19
pom.xml
19
pom.xml
|
@ -98,8 +98,8 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sencha.gxt</groupId>
|
||||
<artifactId>gxt</artifactId>
|
||||
|
@ -120,15 +120,18 @@
|
|||
<artifactId>tabular-data-information-widget</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<!--tabular-data-tasks-widget -->
|
||||
<!-- <dependency>
|
||||
|
||||
<!-- tabular-data-column-widget -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>tabular-data-tasks-widget</artifactId>
|
||||
<artifactId>tabular-data-column-widget</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
|
||||
<!--tabular-data-tasks-widget -->
|
||||
<!-- <dependency> <groupId>org.gcube.portlets.user</groupId> <artifactId>tabular-data-tasks-widget</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version> </dependency> -->
|
||||
|
||||
<!-- LOGGING -->
|
||||
<dependency>
|
||||
<groupId>com.allen-sauer.gwt.log</groupId>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.gcube.portlets.user.td.toolboxwidget.client;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.ChangeColumnTypePanel;
|
||||
import org.gcube.portlets.user.td.informationwidget.client.TabularResourceProperties;
|
||||
import org.gcube.portlets.user.td.toolboxwidget.client.help.HelpPanel;
|
||||
//import org.gcube.portlets.user.td.taskswidget.client.TdTaskController;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
//import com.google.gwt.user.client.ui.DialogBox;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
|
@ -13,11 +13,10 @@ import com.sencha.gxt.widget.core.client.TabItemConfig;
|
|||
import com.sencha.gxt.widget.core.client.TabPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.event.BeforeCloseEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.BeforeCloseEvent.BeforeCloseHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent.BeforeShowHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
//import org.gcube.portlets.user.td.taskswidget.client.TdTaskController;
|
||||
//import org.gcube.portlets.user.td.taskswidget.client.TdTaskController;
|
||||
|
||||
public class ToolBox extends TabPanel {
|
||||
|
||||
|
@ -25,6 +24,7 @@ public class ToolBox extends TabPanel {
|
|||
protected TabularResourceProperties trProperties;
|
||||
protected ToolBoxPanel toolBoxPanel;
|
||||
protected HelpPanel helpPanel;
|
||||
protected ChangeColumnTypePanel changeColumnTypePanel;
|
||||
//protected TdTaskController tdTaskController;
|
||||
//protected DialogBox tdTaskMainWindow;
|
||||
protected FramedPanel taskPanel;
|
||||
|
@ -54,8 +54,8 @@ public class ToolBox extends TabPanel {
|
|||
|
||||
}
|
||||
|
||||
public void openPropertiesTabs() {
|
||||
Log.debug("Open Properties Tabs");
|
||||
public void openPropertiesTab() {
|
||||
Log.debug("Open Properties Tab");
|
||||
if (trProperties == null) {
|
||||
addTrProperties();
|
||||
}
|
||||
|
@ -63,13 +63,32 @@ public class ToolBox extends TabPanel {
|
|||
|
||||
}
|
||||
|
||||
public void openColumnTypeChangeTab(TRId trId, String columnName) {
|
||||
Log.debug("Open Column Type Change Tab");
|
||||
if (changeColumnTypePanel == null) {
|
||||
addChangeColumnTypePanel(trId, columnName);
|
||||
}
|
||||
setActiveWidget(changeColumnTypePanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void closePropertiesTabs() {
|
||||
Log.debug("Close Properties Tabs");
|
||||
Log.debug("Close Properties Tab");
|
||||
if(trProperties!=null){
|
||||
remove(trProperties);
|
||||
trProperties=null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void closeChangeColumnTypePanel(){
|
||||
Log.debug("Close ChangeColumnTypePanel Tab");
|
||||
if (changeColumnTypePanel != null) {
|
||||
remove(changeColumnTypePanel);
|
||||
changeColumnTypePanel=null;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTabs() {
|
||||
|
@ -77,11 +96,11 @@ public class ToolBox extends TabPanel {
|
|||
if (trProperties != null) {
|
||||
trProperties.update();
|
||||
}
|
||||
/*if(tdTaskController!=null){
|
||||
if(tdTaskMainWindow!=null){
|
||||
tdTaskController.updateTasks(true);
|
||||
}
|
||||
}*/
|
||||
if (changeColumnTypePanel != null) {
|
||||
remove(changeColumnTypePanel);
|
||||
changeColumnTypePanel=null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -118,7 +137,31 @@ public class ToolBox extends TabPanel {
|
|||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
protected void addChangeColumnTypePanel(TRId trId, String columnName) {
|
||||
TabItemConfig changeColumnTypeItemConf = new TabItemConfig("Column Type", true);
|
||||
|
||||
changeColumnTypePanel = new ChangeColumnTypePanel(trId,columnName,eventBus);
|
||||
add(changeColumnTypePanel, changeColumnTypeItemConf);
|
||||
|
||||
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
|
||||
|
||||
|
||||
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
|
||||
if (getWidgetCount() == 1) {
|
||||
toolBoxPanel.closePanelOnly();
|
||||
remove(changeColumnTypePanel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
protected void addTdTaskPanel() {
|
||||
|
||||
//tdTaskController = TdTaskController.getInstance();
|
||||
|
|
|
@ -3,7 +3,10 @@ package org.gcube.portlets.user.td.toolboxwidget.client;
|
|||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.WidgetRequestEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.WidgetRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
|
@ -16,6 +19,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
protected ToolBox toolBox;
|
||||
protected ToolBoxPanelState state;
|
||||
protected UIStateType uiStateType;
|
||||
protected WidgetRequestType widgetRequestType;
|
||||
|
||||
|
||||
public ToolBoxPanel(String name, EventBus eventBus) {
|
||||
|
@ -46,6 +50,17 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(WidgetRequestEvent.TYPE,
|
||||
new WidgetRequestEvent.WidgetRequestEventHandler() {
|
||||
|
||||
|
||||
public void onWidgetRequest(WidgetRequestEvent event) {
|
||||
manageWidgetRequestEvents(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
eventBus.addHandler(
|
||||
UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateHandler() {
|
||||
|
@ -62,7 +77,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
Log.debug("ToolBox recieved event: "+event.getRibbonType().toString());
|
||||
switch (event.getRibbonType()){
|
||||
case PROPERTIES:
|
||||
doToolBoxPanelOpenSwitch();
|
||||
doPropertiesOpenTab();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -89,20 +104,49 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void manageWidgetRequestEvents(WidgetRequestEvent event){
|
||||
Log.debug("ToolBox recieved event: "+event.getWidgetRequestType().toString());
|
||||
widgetRequestType = event.getWidgetRequestType();
|
||||
switch (event.getWidgetRequestType()){
|
||||
case CHANGECOLUMNTYPEPANEL:
|
||||
doColumnTypeChangeTab(event.getTrId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void doToolBoxPanelOpenSwitch(){
|
||||
protected void doColumnTypeChangeTab(TRId trId){
|
||||
if (uiStateType == UIStateType.TR_OPEN) {
|
||||
if (state == ToolBoxPanelState.OPENED) {
|
||||
toolBox.openPropertiesTabs();
|
||||
toolBox.openColumnTypeChangeTab(trId, null);
|
||||
Log.debug("ToolBoxPanelSTate.OPENED Add Tabs");
|
||||
} else {
|
||||
enable();
|
||||
expand();
|
||||
state = ToolBoxPanelState.OPENED;
|
||||
toolBox.openPropertiesTabs();
|
||||
toolBox.openColumnTypeChangeTab(trId, null);
|
||||
}
|
||||
} else {
|
||||
Log.debug("ToolBoxPanel No table open");
|
||||
}
|
||||
}
|
||||
|
||||
protected void doPropertiesOpenTab(){
|
||||
if (uiStateType == UIStateType.TR_OPEN) {
|
||||
if (state == ToolBoxPanelState.OPENED) {
|
||||
toolBox.openPropertiesTab();
|
||||
Log.debug("ToolBoxPanelSTate.OPENED Add Tabs");
|
||||
} else {
|
||||
enable();
|
||||
expand();
|
||||
state = ToolBoxPanelState.OPENED;
|
||||
toolBox.openPropertiesTab();
|
||||
}
|
||||
} else {
|
||||
Log.debug("ToolBoxPanel No table open");
|
||||
|
@ -111,6 +155,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public void closePanelOnly(){
|
||||
collapse();
|
||||
disable();
|
||||
|
@ -119,6 +164,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
|
||||
public void closePanel(){
|
||||
toolBox.closePropertiesTabs();
|
||||
toolBox.closeChangeColumnTypePanel();
|
||||
Log.debug("ToolBoxPanel Closed");
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
<inherits name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
|
||||
<inherits name='org.gcube.portlets.user.td.informationwidget.Information' />
|
||||
<inherits name='org.gcube.portlets.user.td.columnwidget.ColumnWidget' />
|
||||
|
||||
<!-- <inherits name='org.gcube.portlets.user.td.taskswidget.TdTasksWidget' /> -->
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
|
|
Loading…
Reference in New Issue