219: Workspace: modify the WorkspaceItem properties
Task-Url: https://support.d4science.org/issues/219 Updated Dialog Edit Permission Updated Icons and Css git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@115351 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2e1902d8d3
commit
f8fec4df8f
|
@ -378,5 +378,8 @@ public interface Icons extends ClientBundle {
|
|||
|
||||
@Source("icons/pencil16.png")
|
||||
ImageResource pencil();
|
||||
|
||||
@Source("icons/edit16.png")
|
||||
ImageResource edit();
|
||||
}
|
||||
|
||||
|
|
|
@ -299,6 +299,11 @@ public class Resources {
|
|||
return AbstractImagePrototype.create(ICONS.pencil());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconEdit(){
|
||||
|
||||
return AbstractImagePrototype.create(ICONS.edit());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconHistory(){
|
||||
|
||||
return AbstractImagePrototype.create(ICONS.history());
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 522 B |
|
@ -53,7 +53,7 @@ public class DialogEditProperties extends Dialog{
|
|||
layout.setDefaultWidth(300);
|
||||
setLayout(layout);
|
||||
|
||||
setHeading("Set Properties: "+item.getName());
|
||||
setHeading("Edit Properties: "+item.getName());
|
||||
setButtonAlign(HorizontalAlignment.RIGHT);
|
||||
setModal(true);
|
||||
// setBodyBorder(true);
|
||||
|
@ -111,7 +111,7 @@ public class DialogEditProperties extends Dialog{
|
|||
public void onSuccess(Void result) {
|
||||
commad.execute();
|
||||
if(closeOnSuccess)
|
||||
DialogEditProperties.this.hide();
|
||||
DialogEditProperties.this.hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.extjs.gxt.ui.client.widget.Dialog;
|
|||
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
||||
import com.extjs.gxt.ui.client.widget.Html;
|
||||
import com.extjs.gxt.ui.client.widget.Label;
|
||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||
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.FormLayout;
|
||||
|
@ -110,10 +111,16 @@ public class DialogGetInfo extends Dialog {
|
|||
hpGcubeProperties.add(labelProperties);
|
||||
loadGcubeItemProperties(fileModel.getIdentifier());
|
||||
htmlPropertiesWidget.setHeight(heightTextArea);
|
||||
htmlPropertiesWidget.setWidth("270px");
|
||||
htmlPropertiesWidget.setWidth("275px");
|
||||
|
||||
Image imgProperties = Resources.getIconPencil().createImage(); //EDIT PROPERTIES
|
||||
hpGcubeProperties.add(imgProperties);
|
||||
LayoutContainer lc = new LayoutContainer();
|
||||
lc.addStyleName("editPermissions");
|
||||
|
||||
Image imgProperties = Resources.getIconEdit().createImage(); //EDIT PROPERTIES
|
||||
imgProperties.setTitle("Edit Properties");
|
||||
lc.add(imgProperties);
|
||||
|
||||
hpGcubeProperties.add(lc);
|
||||
|
||||
final Command cmdReloadProperties = new Command() {
|
||||
|
||||
|
@ -325,8 +332,7 @@ public class DialogGetInfo extends Dialog {
|
|||
htmlPropertiesWidget.unmask();
|
||||
GWT.log("an error occured in load properties by Id "+itemId + " "+caught.getMessage());
|
||||
setVisibleGcubeProperties(true);
|
||||
htmlPropertiesWidget.setHtml("Error on recovering properties");
|
||||
|
||||
htmlPropertiesWidget.setHtml("Error on recovering properties");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -163,4 +163,8 @@ table.userssuggest th {
|
|||
height: 30px;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
}
|
||||
|
||||
.editPermissions :hover{
|
||||
cursor: pointer;
|
||||
}
|
|
@ -2604,7 +2604,7 @@ public class GWTWorkspaceBuilder {
|
|||
|
||||
for (String key : properties.keySet()) {
|
||||
String value = properties.get(key);
|
||||
|
||||
logger.trace("Getting property: ["+key+","+properties.get(key)+"]");
|
||||
html+="<span style=\"font-weight:bold; padding-top: 5px;\">"+key+": </span>";
|
||||
html+="<span style=\"font-weight:normal;\">";
|
||||
html+=value;
|
||||
|
@ -2630,12 +2630,18 @@ public class GWTWorkspaceBuilder {
|
|||
if(item instanceof GCubeItem){
|
||||
GCubeItem gItem = (GCubeItem) item;
|
||||
try {
|
||||
return gItem.getProperties().getProperties();
|
||||
if(gItem.getProperties()!=null){
|
||||
Map<String, String> map = gItem.getProperties().getProperties();
|
||||
HashMap<String, String> properties = new HashMap<String, String>(map.size()); //TO PREVENT GWT SERIALIZATION ERROR
|
||||
for (String key : map.keySet())
|
||||
properties.put(key, map.get(key));
|
||||
|
||||
return properties;
|
||||
}
|
||||
} catch (InternalErrorException e) {
|
||||
logger.error("Error in server getItemProperties: ", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -3827,9 +3827,12 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|||
Workspace workspace = getWorkspace();
|
||||
WorkspaceItem item = workspace.getItem(itemId);
|
||||
if(item instanceof GCubeItem){
|
||||
workspaceLogger.info("Adding "+properties.size()+" properties to GCubeItem: "+itemId);
|
||||
GCubeItem gItem = (GCubeItem) item;
|
||||
for (String key : properties.keySet()) //ADD PROPERTIES
|
||||
gItem.getProperties().addProperty(key, properties.get(key));
|
||||
for (String key : properties.keySet()) {//ADD PROPERTIES
|
||||
workspaceLogger.trace("Adding property: ["+key+","+properties.get(key)+"]");
|
||||
gItem.getProperties().addProperty(key, properties.get(key));
|
||||
}
|
||||
}else
|
||||
throw new NoGcubeItemTypeException("The item is not a Gcube Item");
|
||||
|
||||
|
|
Loading…
Reference in New Issue