2546: Endow Workspace Resources Explorer with filtering and display features
Task-Url: https://support.d4science.org/issues/2546 Added Dialog to show Gcube Properties Updated pom version at 1.4.0 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@128645 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8055e5f2d7
commit
00d5f1938b
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>workspace-explorer</artifactId>
|
||||
<version>1.3.0-SNAPSHOT</version>
|
||||
<version>1.4.0-SNAPSHOT</version>
|
||||
<name>gCube Workspace Explorer</name>
|
||||
<description>
|
||||
gCube Workspace Explorer widget allows to navigate (gCube) Workspace
|
||||
|
|
|
@ -37,5 +37,12 @@ public interface WorkspaceExplorerIcons extends ClientBundle {
|
|||
|
||||
@Source("info-icon.png")
|
||||
ImageResource info();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Source("info-square.png")
|
||||
ImageResource infoSquare();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,11 @@ public class WorkspaceExplorerResources {
|
|||
return AbstractImagePrototype.create(ICONS.info());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconInfoSquare() {
|
||||
|
||||
return AbstractImagePrototype.create(ICONS.infoSquare());
|
||||
}
|
||||
|
||||
/** My custom base icon collection */
|
||||
public enum CustomIconType implements BaseIconType {
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 325 B |
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.widgets.wsexplorer.client.view.gcubeitem;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 17, 2016
|
||||
*/
|
||||
public class DialogGcubeItem {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public DialogGcubeItem(String id) {
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
|
@ -66,12 +66,12 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
|
|||
});
|
||||
|
||||
vpContainer = new VerticalPanel();
|
||||
vpContainer.getElement().getStyle().setMargin(20.0, Unit.PX);
|
||||
// vpContainer.getElement().getStyle().setMargin(5.0, Unit.PX);
|
||||
vpContainer.add(new HTML(text));
|
||||
hpButtons = new HorizontalPanel();
|
||||
hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
||||
hpButtons.setSpacing(3);
|
||||
yesButton.getElement().getStyle().setMarginRight(20.0, Unit.PX);
|
||||
// yesButton.getElement().getStyle().setMarginRight(20.0, Unit.PX);
|
||||
hpButtons.add(yesButton);
|
||||
|
||||
dock.add(hpButtons, DockPanel.SOUTH);
|
||||
|
@ -113,17 +113,28 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
|
|||
private FlexTable buildGcubeItemView(Map<String, String> map){
|
||||
|
||||
FlexTable table = new FlexTable();
|
||||
table.setWidth("100%");
|
||||
|
||||
|
||||
if(map.size()==0){
|
||||
table.setHTML(0, 0, "No properties");
|
||||
table.setHTML(0, 0, "No have properties");
|
||||
return table;
|
||||
}
|
||||
|
||||
table.addStyleName("gcube-item-table");
|
||||
table.setHTML(0, 0, "N.");
|
||||
table.setHTML(0, 1, "Key");
|
||||
table.setHTML(0, 2, "Value");
|
||||
table.getRowFormatter().getElement(0).addClassName("gcube-item-table-header");
|
||||
|
||||
int i = 0;
|
||||
for (String key : map.keySet()) {
|
||||
String value = map.get(key);
|
||||
table.setHTML(i, 0, key);
|
||||
table.setHTML(i, 1, value);
|
||||
int index = i+1;
|
||||
table.setHTML(index, 0, index+"-");
|
||||
table.setHTML(index, 1, key);
|
||||
table.setHTML(index, 2, value);
|
||||
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public abstract class AbstractItemsCellTable<T> {
|
|||
this.showMoreInfo = fireOnClick;
|
||||
cellTable = new CellTable<T>(1, CellTableResources.INSTANCE);
|
||||
cellTable.addStyleName("table-overflow");
|
||||
cellTable.addStyleName("table-vertical-middle");
|
||||
cellTable.setStriped(true);
|
||||
cellTable.setCondensed(true);
|
||||
cellTable.setWidth("100%", true);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ItemsTable<T extends Item> extends AbstractItemsCellTable<T> implem
|
|||
private TextColumn<T> name;
|
||||
private TextColumn<T> owner;
|
||||
public DateTimeFormat dtformat = DateTimeFormat.getFormat("dd MMM hh:mm aaa yyyy");
|
||||
public ImageResource info = WorkspaceExplorerResources.ICONS.info();
|
||||
public ImageResource info = WorkspaceExplorerResources.ICONS.infoSquare();
|
||||
// private Item selectedItem = null;
|
||||
|
||||
/**
|
||||
|
@ -286,38 +286,62 @@ public class ItemsTable<T extends Item> extends AbstractItemsCellTable<T> implem
|
|||
}
|
||||
};
|
||||
|
||||
Column<T, ImageResource> showGcubeInfoClm = new Column<T, ImageResource>(showGcubeInfo) {
|
||||
MyToolTipColumn<T, ImageResource> showGcubeInfoClm = new MyToolTipColumn<T, ImageResource>(showGcubeInfo, "Show gcube properties") {
|
||||
|
||||
@Override
|
||||
public ImageResource getValue(T object) {
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Context context, T object, SafeHtmlBuilder sb) {
|
||||
super.render(context, object, sb);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.user.cellview.client.Column#onBrowserEvent(com.google.gwt.cell.client.Cell.Context, com.google.gwt.dom.client.Element, java.lang.Object, com.google.gwt.dom.client.NativeEvent)
|
||||
*/
|
||||
@Override
|
||||
public void onBrowserEvent(
|
||||
Context context, Element elem, T object, NativeEvent event) {
|
||||
super.onBrowserEvent(context, elem, object, event);
|
||||
if ("click".equals(event.getType())) {
|
||||
Item item = object;
|
||||
DialogShowGcubeItem dg = new DialogShowGcubeItem("Gcube Properties for: "+item.getName(), null, item);
|
||||
dg.setPopupPosition(event.getClientX(), event.getClientY());
|
||||
dg.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*Column<T, ImageResource> showGcubeInfoClm = new Column<T, ImageResource>(showGcubeInfo) {
|
||||
@Override
|
||||
public ImageResource getValue(T dataObj) {
|
||||
return info;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.user.cellview.client.Column#render(com.google.gwt.cell.client.Cell.Context, java.lang.Object, com.google.gwt.safehtml.shared.SafeHtmlBuilder)
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public void render(Context context, T object, SafeHtmlBuilder sb) {
|
||||
super.render(context, object, sb);
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.user.cellview.client.Column#onBrowserEvent(com.google.gwt.cell.client.Cell.Context, com.google.gwt.dom.client.Element, java.lang.Object, com.google.gwt.dom.client.NativeEvent)
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onBrowserEvent(
|
||||
Context context, Element elem, T object, NativeEvent event) {
|
||||
public void onBrowserEvent(Context context, Element elem, T object, NativeEvent event) {
|
||||
|
||||
super.onBrowserEvent(context, elem, object, event);
|
||||
if ("click".equals(event.getType())) {
|
||||
Item item = object;
|
||||
DialogShowGcubeItem dg = new DialogShowGcubeItem("Gcube Items for: "+item.getName(), null, item);
|
||||
DialogShowGcubeItem dg = new DialogShowGcubeItem("Gcube Properties for: "+item.getName(), null, item);
|
||||
dg.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
};*/
|
||||
|
||||
showGcubeInfoClm.setSortable(false);
|
||||
cellTable.addColumn(showGcubeInfoClm, "");
|
||||
cellTable.setColumnWidth(showGcubeInfoClm, 10.0, Unit.PCT);
|
||||
}
|
||||
|
||||
/*final SingleSelectionModel<Item> selectionModel = new SingleSelectionModel<Item>();
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
package org.gcube.portlets.widgets.wsexplorer.client.view.grid;
|
||||
|
||||
import com.google.gwt.cell.client.Cell;
|
||||
import com.google.gwt.cell.client.Cell.Context;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
|
||||
public abstract class MyToolTipColumn<T, C> extends Column<T, C> {
|
||||
|
||||
interface Templates extends SafeHtmlTemplates {
|
||||
|
||||
@Template("<div title=\"{0}\">")
|
||||
SafeHtml startToolTip(String toolTipText);
|
||||
|
||||
@Template("</div>")
|
||||
SafeHtml endToolTip();
|
||||
}
|
||||
private static final Templates TEMPLATES = GWT.create(Templates.class);
|
||||
private final String toolTipText;
|
||||
|
||||
public MyToolTipColumn(final Cell<C> cell, final String toolTipText) {
|
||||
|
||||
super(cell);
|
||||
this.toolTipText = toolTipText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(final Context context, final T object, final SafeHtmlBuilder sb) {
|
||||
|
||||
sb.append(TEMPLATES.startToolTip(toolTipText));
|
||||
super.render(context, object, sb);
|
||||
sb.append(TEMPLATES.endToolTip());
|
||||
}
|
||||
}
|
|
@ -1221,13 +1221,6 @@ a:hover, a:focus {
|
|||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.table-overflow td, th {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.table-overflow th{
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.breadcrumbs-navigator .breadcrumb {
|
||||
margin-bottom: 5px !important;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
/* div.input-append > input, div.input-append > textarea, div.input-append > select, div.input-append > .uneditable-input { */
|
||||
/* margin-bottom: 0; */
|
||||
/* } */
|
||||
|
||||
.gwt-PopupPanel .gwt-DatePicker {
|
||||
width: 200px;
|
||||
}
|
||||
|
@ -81,24 +82,28 @@
|
|||
|
||||
/**** GWT DIALOG NEW STYLE****/
|
||||
.gwt-DialogBoxNew{
|
||||
border: 8px solid #99C0E8;
|
||||
border: 8px solid #EEEEEE;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
box-shadow: none;
|
||||
line-height: 7px;
|
||||
/* line-height: 7px; */
|
||||
opacity: 1;
|
||||
z-index: 2000;
|
||||
background-color: #FFFFFF;
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
.gwt-DialogBoxNew .Caption {
|
||||
background: none repeat scroll 0 0 #99C0E8;
|
||||
border: medium none #D4D4D4;
|
||||
background: none repeat scroll 0 0 #EEEEEE;
|
||||
padding: 2px;
|
||||
border-bottom: 1px solid #dadada;
|
||||
cursor: default;
|
||||
font-family: Arial Unicode MS, Arial, sans-serif !important;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
line-height: 27px;
|
||||
padding: 2px 0px 0px 0px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
.gwt-DialogBoxNew table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.gwt-DialogBoxNew .dialogContent {
|
||||
|
@ -147,5 +152,38 @@
|
|||
-background: url(images/circles_ie6.png) no-repeat -8px -36px; */
|
||||
|
||||
}
|
||||
/**** END GWT DIALOG NEW STYLE ****/
|
||||
|
||||
/**** END GWT DIALOG NEW STYLE ****/
|
||||
|
||||
/*** TABLE ***/
|
||||
|
||||
.table-overflow td, th {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.table-vertical-middle td, th {
|
||||
height: 50%;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
.table-overflow th{
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.gcube-item-table{
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.gcube-item-table td{
|
||||
border-bottom: 1px solid #EEE;
|
||||
height: 50%;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.gcube-item-table-header{
|
||||
background-color: #dedede;
|
||||
text-align: center;
|
||||
}
|
||||
/******* END TABLE ********/
|
Loading…
Reference in New Issue