Added Tabular Resource Information Dialog

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-open-widget@115366 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-12 15:53:38 +00:00 committed by Giancarlo Panichi
parent fc9cd597d6
commit 37af50b145
24 changed files with 806 additions and 51 deletions

View File

@ -0,0 +1,277 @@
package org.gcube.portlets.user.td.openwidget.client;
import java.util.ArrayList;
import java.util.Date;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData;
import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.openwidget.client.custom.IconButton;
import org.gcube.portlets.user.td.openwidget.client.resources.ResourceBundleTDOpen;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.form.CheckBox;
import com.sencha.gxt.widget.core.client.form.DateField;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.form.FieldSet;
import com.sencha.gxt.widget.core.client.form.TextArea;
import com.sencha.gxt.widget.core.client.form.TextField;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TabResourceInfoDialog extends Dialog {
private static final int HEIGHT = 500;
private static final int WIDTH = 500;
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
private TabResource tabResource;
private TabResourcesInfoDialogPropertiesMessages msgs;
private EventBus eventBus;
private ArrayList<LicenceData> licencesList;
public TabResourceInfoDialog(TabResource tabResource, EventBus eventBus) {
this.tabResource = tabResource;
this.eventBus=eventBus;
this.msgs = GWT.create(TabResourcesInfoDialogPropertiesMessages.class);
initWindow();
retrieveLicencesList();
}
protected void initWindow() {
setModal(true);
setHeadingText(msgs.tabResourceInfoDialogHeadingText());
getHeader().setIcon(ResourceBundleTDOpen.INSTANCE.information());
setPredefinedButtons(PredefinedButton.OK);
setHideOnButtonClick(true);
setButtonAlign(BoxLayoutPack.CENTER);
setWidth(WIDTH);
setHeight(HEIGHT);
}
protected void create() {
FieldSet configurationFieldSet = new FieldSet();
configurationFieldSet.setHeadingText(msgs.tabResourceDetailFieldSet());
configurationFieldSet.setCollapsible(false);
configurationFieldSet.setBorders(true);
VerticalLayoutContainer configurationFieldSetLayout = new VerticalLayoutContainer();
configurationFieldSet.add(configurationFieldSetLayout,
new MarginData(0));
TextField trName = new TextField();
trName.setValue(tabResource.getName());
trName.setReadOnly(true);
FieldLabel trNameLabel = new FieldLabel(trName, msgs.nameLabel());
configurationFieldSetLayout.add(trNameLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
IconButton trBtnLock = new IconButton();
if(tabResource.isLocked()){
trBtnLock.setIcon(ResourceBundleTDOpen.INSTANCE.lock());
} else {
trBtnLock.setIcon(ResourceBundleTDOpen.INSTANCE.lockOpen());
}
FieldLabel trLockLabel = new FieldLabel(trBtnLock, msgs.lockLabel());
configurationFieldSetLayout.add(trLockLabel, new VerticalLayoutData(
-1, -1, new Margins(0)));
TextArea trDescription = new TextArea();
trDescription.setValue(tabResource.getDescription());
trDescription.setReadOnly(true);
FieldLabel trDescriptionLabel = new FieldLabel(trDescription,
msgs.descriptionLabel());
configurationFieldSetLayout.add(trDescriptionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
TextField trType = new TextField();
trType.setValue(tabResource.getTabResourceType());
trType.setReadOnly(true);
FieldLabel trTypeLabel = new FieldLabel(trType, msgs.typeLabel());
configurationFieldSetLayout.add(trTypeLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextField trAgency = new TextField();
trAgency.setValue(tabResource.getAgency());
trAgency.setReadOnly(true);
FieldLabel trAgencyLabel = new FieldLabel(trAgency, msgs.agencyLabel());
configurationFieldSetLayout.add(trAgencyLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextField trCreationDate = new TextField();
trCreationDate.setValue(tabResource.getDate());
trCreationDate.setReadOnly(true);
FieldLabel trCreationDateLabel = new FieldLabel(trCreationDate,
msgs.dateLabel());
configurationFieldSetLayout.add(trCreationDateLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
TextField trTableType = new TextField();
trTableType.setValue(tabResource.getTableTypeName());
trTableType.setReadOnly(true);
FieldLabel trTableTypeLabel = new FieldLabel(trTableType, msgs.tableTypeNameLabel());
configurationFieldSetLayout.add(trTableTypeLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea trRight = new TextArea();
trRight.setValue(tabResource.getRight());
trRight.setReadOnly(true);
FieldLabel trRightLabel = new FieldLabel(trRight, msgs.rightLabel());
configurationFieldSetLayout.add(trRightLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
DateField trValidFromField = new DateField();
trValidFromField.setReadOnly(true);
FieldLabel trValidFromLabel=new FieldLabel(trValidFromField, msgs.validFromLabel());
trValidFromField.clear();
if (tabResource.getValidFrom() == null
|| tabResource.getValidFrom().isEmpty()) {
Log.debug("ValidFrom null or empty");
} else {
Date vFrom;
try {
vFrom = sdf.parse(tabResource.getValidFrom());
trValidFromField.setValue(vFrom);
} catch (IllegalArgumentException e) {
Log.error("Error Parsing Valid From for Tabular Resource: "
+ tabResource);
e.printStackTrace();
}
}
configurationFieldSetLayout.add(trValidFromLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
DateField trValidUntilToField = new DateField();
trValidUntilToField.setReadOnly(true);
FieldLabel trValidUntilToLabel= new FieldLabel(trValidUntilToField,
msgs.validUntilToLabel());
trValidUntilToField.clear();
if (tabResource.getValidUntilTo() == null
|| tabResource.getValidUntilTo().isEmpty()) {
Log.debug("ValidUntilTo null or empty");
} else {
Date vUntilTo;
try {
vUntilTo = sdf.parse(tabResource.getValidUntilTo());
trValidUntilToField.setValue(vUntilTo);
} catch (IllegalArgumentException e) {
Log.error("Error Parsing Valid Until To for Tabular Resource: "
+ tabResource);
e.printStackTrace();
}
}
configurationFieldSetLayout.add(trValidUntilToLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
String licence="";
for(LicenceData licenceData:licencesList){
if(licenceData.getLicenceId().compareTo(tabResource.getLicence())==0){
licence=licenceData.getLicenceName();
break;
}
}
TextField trLicence = new TextField();
trLicence.setValue(licence);
trLicence.setReadOnly(true);
FieldLabel trLicenceLabel = new FieldLabel(trLicence, msgs.licencesLabel());
configurationFieldSetLayout.add(trLicenceLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextField trOwner = new TextField();
trOwner.setValue(tabResource.getOwnerLogin());
trOwner.setReadOnly(true);
FieldLabel trOwnerLabel = new FieldLabel(trOwner, msgs.ownerLabel());
configurationFieldSetLayout.add(trOwnerLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
IconButton trBtnShare = new IconButton();
trBtnShare.setIcon(ResourceBundleTDOpen.INSTANCE.share());
FieldLabel trShareLabel = new FieldLabel(trBtnShare, msgs.shareLabel());
ArrayList<Contacts> contacts = tabResource.getContacts();
if (contacts != null && contacts.size() > 0) {
trShareLabel.setVisible(true);
} else {
trShareLabel.setVisible(false);
}
configurationFieldSetLayout.add(trShareLabel, new VerticalLayoutData(
-1, -1, new Margins(0)));
CheckBox trValidField = new CheckBox();
trValidField.setValue(tabResource.isValid());
trValidField.setReadOnly(true);
FieldLabel trValidLabel=new FieldLabel(trValidField, msgs.validLabel());
configurationFieldSetLayout.add(trValidLabel, new VerticalLayoutData(
-1, -1, new Margins(0)));
CheckBox trFinalizedField = new CheckBox();
trFinalizedField.setValue(tabResource.isFinalized());
trFinalizedField.setReadOnly(true);
FieldLabel trFinalizedLabel=new FieldLabel(trFinalizedField, msgs.finalizedLabel());
configurationFieldSetLayout.add(trFinalizedLabel, new VerticalLayoutData(
-1, -1, new Margins(0)));
add(configurationFieldSet, new MarginData(0));
}
protected void retrieveLicencesList() {
TDGWTServiceAsync.INSTANCE
.getLicences(new AsyncCallback<ArrayList<LicenceData>>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving licences:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving licences.");
}
}
public void onSuccess(ArrayList<LicenceData> result) {
Log.trace("loaded " + result.size() + " LicenceData");
licencesList = result;
create();
}
});
}
}

View File

@ -0,0 +1,129 @@
package org.gcube.portlets.user.td.openwidget.client;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface TabResourcesInfoDialogPropertiesMessages extends Messages {
@DefaultMessage("Tabular Resource Info")
String tabResourceInfoDialogHeadingText();
@DefaultMessage("Detail")
String tabResourceDetailFieldSet();
//
@DefaultMessage("Name")
String nameLabel();
@DefaultMessage("Lock")
String lockLabel();
@DefaultMessage("Name of tabular resource")
String nameLabelToolTip();
@DefaultMessage("Description")
String descriptionLabel();
@DefaultMessage("Description of tabular resource")
String descriptionLabelToolTip();
@DefaultMessage("Type")
String typeLabel();
@DefaultMessage("Type of tabular resource")
String typeLabelToolTip();
@DefaultMessage("Agency")
String agencyLabel();
@DefaultMessage("Agency")
String agencyLabelToolTip();
@DefaultMessage("Creation Date")
String dateLabel();
@DefaultMessage("Creation Date")
String dateLabelToolTip();
@DefaultMessage("Table Type")
String tableTypeNameLabel();
@DefaultMessage("Table Type")
String tableTypeNameLabelToolTip();
@DefaultMessage("Rights")
String rightLabel();
@DefaultMessage("Rights")
String rightLabelToolTip();
@DefaultMessage("Valid From")
String validFromLabel();
@DefaultMessage("Valid From")
String validFromLabelToolTip();
@DefaultMessage("Valid Until To")
String validUntilToLabel();
@DefaultMessage("Valid Until To")
String validUntilToLabelToolTip();
@DefaultMessage("Licence")
String licencesLabel();
@DefaultMessage("Licence")
String licencesLabelToolTip();
@DefaultMessage("Owner")
String ownerLabel();
@DefaultMessage("Owner")
String ownerLabelToolTip();
@DefaultMessage("Share")
String shareLabel();
@DefaultMessage("Share")
String shareLabelToolTip();
@DefaultMessage("Valid")
String validLabel();
@DefaultMessage("Valid")
String validLabelToolTip();
@DefaultMessage("Final")
String finalizedLabel();
@DefaultMessage("Final")
String finalizedLabelToolTip();
@DefaultMessage("Save")
String saveButton();
@DefaultMessage("Save")
String saveButtonToolTip();
@DefaultMessage("Validations")
String validationsButton();
@DefaultMessage("Validations")
String validationsButtonToolTip();
@DefaultMessage("Resources")
String resourcesButton();
@DefaultMessage("Resources")
String resourcesButtonToolTip();
}

View File

@ -82,7 +82,6 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
}
private Grid<TabResource> grid;
private ResourceBundle res;
private Menu contextMenu;
@ -105,7 +104,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
}
try {
buildPanel();
} catch (Throwable e) {
Log.debug("Error building panel:" + e.getMessage());
e.printStackTrace();
@ -132,10 +131,10 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
IdentityValueProvider<TabResource> identity = new IdentityValueProvider<TabResource>();
final CheckBoxSelectionModel<TabResource> sm = new CheckBoxSelectionModel<TabResource>(
identity);
TabResourcesProperties properties = GWT
.create(TabResourcesProperties.class);
final ExtendedListStore<TabResource> store = new ExtendedListStore<TabResource>(
properties.id());
@ -160,37 +159,28 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
store.setEnableFilters(true);
ColumnConfig<TabResource, String> nameColumn = new ColumnConfig<TabResource, String>(
properties.name(), 90, "Name");
/*
nameColumn.setCell(
new AbstractCell<String>() {
* nameColumn.setCell( new AbstractCell<String>() {
*
* @Override public void render(Context context, String value,
* SafeHtmlBuilder sb) { TabResource
* tabResource=store.get(context.getIndex());
*
* final NameTooltipTemplates nameToolTipTemplates = GWT
* .create(NameTooltipTemplates.class); String valueSafe=""; String
* descriptionSafe="";
*
* if(value!=null){ valueSafe=SafeHtmlUtils.htmlEscape(value); }
* if(tabResource!=null && tabResource.getAgency()!=null){
* descriptionSafe=SafeHtmlUtils.htmlEscape(tabResource.getAgency()); }
* sb.append(nameToolTipTemplates.format(valueSafe, descriptionSafe));
*
* } });
*/
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
TabResource tabResource=store.get(context.getIndex());
final NameTooltipTemplates nameToolTipTemplates = GWT
.create(NameTooltipTemplates.class);
String valueSafe="";
String descriptionSafe="";
if(value!=null){
valueSafe=SafeHtmlUtils.htmlEscape(value);
}
if(tabResource!=null && tabResource.getAgency()!=null){
descriptionSafe=SafeHtmlUtils.htmlEscape(tabResource.getAgency());
}
sb.append(nameToolTipTemplates.format(valueSafe, descriptionSafe));
}
});*/
ColumnConfig<TabResource, String> typeColumn = new ColumnConfig<TabResource, String>(
properties.tabResourceType(), 30, "Type");
ColumnConfig<TabResource, String> tableTypeNameColumn = new ColumnConfig<TabResource, String>(
@ -217,14 +207,14 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
} else {
sb.appendHtmlConstant("<img style='margin:auto;padding:auto;display:block;' src='"
+ ResourceBundleTDOpen.INSTANCE.lockOpen().getSafeUri()
.asString() + "' alt='true'>");
+ ResourceBundleTDOpen.INSTANCE.lockOpen()
.getSafeUri().asString() + "' alt='true'>");
}
}
});
List<ColumnConfig<TabResource, ?>> columns=new ArrayList<ColumnConfig<TabResource,?>>();
List<ColumnConfig<TabResource, ?>> columns = new ArrayList<ColumnConfig<TabResource, ?>>();
columns.add(nameColumn);
columns.add(typeColumn);
columns.add(tableTypeNameColumn);
@ -232,11 +222,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
columns.add(ownerColumn);
columns.add(agencyColumn);
columns.add(dateColumn);
ColumnModel<TabResource> cm = new ColumnModel<TabResource>(columns);
RpcProxy<ListLoadConfig, ListLoadResult<TabResource>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<TabResource>>() {
public void load(ListLoadConfig loadConfig,
@ -262,9 +250,6 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
});
}
};
sm.setSelectionMode(SelectionMode.SINGLE);
grid.setLoader(loader);
@ -337,6 +322,71 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
});
contextMenu.add(deleteTRItem);
MenuItem infoItem = new MenuItem();
infoItem.setText("Info");
infoItem.setIcon(ResourceBundleTDOpen.INSTANCE.information());
infoItem.addSelectionHandler(new SelectionHandler<Item>() {
@Override
public void onSelection(SelectionEvent<Item> event) {
if (grid != null) {
TabResource tabResource = getSelectedItem();
requestInfo(tabResource);
}
}
});
contextMenu.add(infoItem);
}
protected void openInfoDialog(TabResource tabResource) {
final TabResourceInfoDialog tabResourceInfoDialog = new TabResourceInfoDialog(
tabResource, parent.getEventBus());
tabResourceInfoDialog.show();
}
protected void requestInfo(TabResource tabResource) {
if(tabResource.isLocked()){
UtilsGXT3.alert("Attention", "Tabular Resource is locked no info available!");
return;
}
TDGWTServiceAsync.INSTANCE.getTabResourceInformation(
tabResource.getTrId(), new AsyncCallback<TabResource>() {
public void onSuccess(TabResource result) {
Log.info("Retrived TR: " + result.getTrId());
openInfoDialog(result);
}
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
parent.getEventBus()
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error("Tabular Resource is Locked: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide("Error",
caught.getLocalizedMessage(), "", caught);
} else {
Log.error("Error: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide("Error",
caught.getLocalizedMessage(), "", caught);
}
}
}
});
}
protected boolean select(TabResource item, String searchTerm) {
@ -377,9 +427,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
} else {
Log.error("Error retrieving tabular resource: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide(
"Error",
caught.getLocalizedMessage(),"", caught);
parent.showErrorAndHide("Error",
caught.getLocalizedMessage(), "", caught);
}
callback.onFailure(caught);
}
@ -389,9 +438,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
+ " TabularResources");
ArrayList<TabResource> avaibles = new ArrayList<TabResource>();
for (TabResource tResource : result) {
//if (!tResource.isLocked()) {
// if (!tResource.isLocked()) {
avaibles.add(tResource);
//}
// }
}
/*
@ -486,7 +535,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
Log.error("Error on delete TabResource: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
caught.getLocalizedMessage());
caught.getLocalizedMessage());
}
}
}

View File

@ -0,0 +1,75 @@
package org.gcube.portlets.user.td.openwidget.client.custom;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.ui.Image;
import com.sencha.gxt.core.client.XTemplates;
import com.sencha.gxt.core.client.dom.XElement;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DefaultAppearance implements IconButtonAppearance {
public interface Template extends XTemplates {
@XTemplate(source = "IconButton.html")
SafeHtml template(IconButtonStyle style);
}
public interface IconButtonStyle extends CssResource {
@ClassName("iconButton")
public String getIconButton();
@ClassName("iconButtonImage")
public String getIconButtonImage();
@ClassName("iconButtonRef")
public String getIconButtonRef();
}
private final IconButtonStyle style;
private final Template template;
public interface IconButtonResources extends ClientBundle {
public static final IconButtonResources INSTANCE = GWT.create(IconButtonResources.class);
@Source("IconButtonStyle.css")
IconButtonStyle style();
}
public DefaultAppearance() {
this(IconButtonResources.INSTANCE);
}
public DefaultAppearance(IconButtonResources resources) {
this.style = resources.style();
this.style.ensureInjected();
this.template = GWT.create(Template.class);
}
public void onUpdateIcon(XElement parent, ImageResource icon) {
XElement element = parent.selectNode("." + style.getIconButtonImage());
Image image=new Image(icon);
Element img=image.getElement();
img.setClassName(style.getIconButtonRef());
element.appendChild(img);
}
public void render(SafeHtmlBuilder sb) {
sb.append(template.template(style));
}
}

View File

@ -0,0 +1,4 @@
<!-- file: ./IconButton.html -->
<div class="{style.iconButton}">
<div class="{style.iconButtonImage}"></div>
</div>

View File

@ -0,0 +1,50 @@
package org.gcube.portlets.user.td.openwidget.client.custom;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Event;
import com.sencha.gxt.core.client.dom.XDOM;
import com.sencha.gxt.core.client.dom.XElement;
import com.sencha.gxt.widget.core.client.Component;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class IconButton extends Component implements HasClickHandlers {
private IconButtonAppearance appearance;
public IconButton() {
this((IconButtonAppearance) GWT.create(DefaultAppearance.class));
}
public IconButton(IconButtonAppearance appearance) {
this.appearance = appearance;
SafeHtmlBuilder sb = new SafeHtmlBuilder();
this.appearance.render(sb);
XElement element=XDOM.create(sb.toSafeHtml());
setElement((Element)element);
sinkEvents(Event.ONCLICK);
}
public HandlerRegistration addClickHandler(ClickHandler handler) {
return addDomHandler(handler, ClickEvent.getType());
}
public void setIcon(ImageResource icon) {
appearance.onUpdateIcon(getElement(), icon);
}
}

View File

@ -0,0 +1,16 @@
package org.gcube.portlets.user.td.openwidget.client.custom;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.sencha.gxt.core.client.dom.XElement;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface IconButtonAppearance {
void render(SafeHtmlBuilder sb);
void onUpdateIcon(XElement parent, ImageResource icon);
}

View File

@ -0,0 +1,17 @@
@CHARSET "UTF-8";
.iconButton {
border: none;
font-size: 12px;
margin: 0px;
padding: 0px;
}
.iconButton .iconButtonImage {
vertical-align: center;
}
.iconButtonRef {
vertical-align: center;
cursor: pointer;
}

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.openwidget.client.resources;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ClientBundle.Source;
/**
*
@ -33,8 +34,17 @@ public interface ResourceBundleTDOpen extends ClientBundle {
@Source("lock-open-green_32.png")
ImageResource lockOpen32();
@Source("page-white-share.png")
ImageResource share();
@Source("page-white-share_32.png")
ImageResource share32();
@Source("information.png")
ImageResource information();
@Source("information_32.png")
ImageResource information32();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,2 +0,0 @@
sendButton = Send
nameField = Enter your name

View File

@ -1,2 +0,0 @@
sendButton = Envoyer
nameField = Entrez votre nom

View File

@ -0,0 +1,37 @@
tabResourceInfoDialogHeadingText = Tabular Resource Info
tabResourceDetailFieldSet = Detail
nameLabel = Name
lockLabel = Lock
nameLabelToolTip = Name of tabular resource
descriptionLabel = Description
descriptionLabelToolTip = Description of tabular resource
typeLabel = Type
typeLabelToolTip = Type of tabular resource
agencyLabel = Agency
agencyLabelToolTip = Agency
dateLabel = Creation Date
dateLabelToolTip = Creation Date
tableTypeNameLabel = Table Type
tableTypeNameLabelToolTip = Table Type
rightLabel = Rights
rightLabelToolTip = Rights
validFromLabel = Valid From
validFromLabelToolTip = Valid From
validUntilToLabel = Valid Until To
validUntilToLabelToolTip = Valid Until To
licencesLabel = Licence
licencesLabelToolTip = Licence
ownerLabel = Owner
ownerLabelToolTip = Owner
shareLabel = Share
shareLabelToolTip = Share
validLabel = Valid
validLabelToolTip = Valid
finalizedLabel = Final
finalizedLabelToolTip = Final
saveButton = Save
saveButtonToolTip = Save
validationsButton = Validations
validationsButtonToolTip = Validations
resourcesButton = Resources
resourcesButtonToolTip = Resources

View File

@ -0,0 +1,37 @@
tabResourceInfoDialogHeadingText = Tabular Resource Información
tabResourceDetailFieldSet = Detalle
nameLabel = Nombre
lockLabel = Lock
nameLabelToolTip = Nombre de la tabular resource
descriptionLabel = Descripción
descriptionLabelToolTip = Descripción de la tabular resource
typeLabel = Tipo
typeLabelToolTip = Tipo de tabular resource
agencyLabel = Agencia
agencyLabelToolTip = Agencia
dateLabel = Fecha Creacion
dateLabelToolTip = Fecha Creacion
tableTypeNameLabel = Tipo Tabla
tableTypeNameLabelToolTip = Tipo Tabla
rightLabel = Derechos
rightLabelToolTip = Derechos
validFromLabel = Válida Desde
validFromLabelToolTip = Válida Desde
validUntilToLabel = Válido Hasta
validUntilToLabelToolTip = Válido Hasta
licencesLabel = Licencia
licencesLabelToolTip = Licencia
ownerLabel = Propietario
ownerLabelToolTip = Propietario
shareLabel = Cuota
shareLabelToolTip = Cuota
validLabel = Válido
validLabelToolTip = Válido
finalizedLabel = Final
finalizedLabelToolTip = Final
saveButton = Guardar
saveButtonToolTip = Guardar
validationsButton = Validaciones
validationsButtonToolTip = Validaciones
resourcesButton = Recursos
resourcesButtonToolTip = Recursos

View File

@ -0,0 +1,37 @@
tabResourceInfoDialogHeadingText = Tabular Resource Informazioni
tabResourceDetailFieldSet = Dettagli
nameLabel = Nome
lockLabel = Lock
nameLabelToolTip = Nome della tabular resource
descriptionLabel = Descrizione
descriptionLabelToolTip = Descrizione della tabular resource
typeLabel = Tipo
typeLabelToolTip = Tipo di tabular resource
agencyLabel = Agenzia
agencyLabelToolTip = Agenzia
dateLabel = Data Creazione
dateLabelToolTip = Data Creazione
tableTypeNameLabel = Tipo Tabella
tableTypeNameLabelToolTip = Tipo Tabella
rightLabel = Diritti
rightLabelToolTip = Diritti
validFromLabel = Valida Da
validFromLabelToolTip = Valida Da
validUntilToLabel = Valida Fino Al
validUntilToLabelToolTip = Valida Fino Al
licencesLabel = Licenza
licencesLabelToolTip = Licenza
ownerLabel = Proprietario
ownerLabelToolTip = Proprietario
shareLabel = Condivisione
shareLabelToolTip = Condivisione
validLabel = Valida
validLabelToolTip = Valida
finalizedLabel = Finale
finalizedLabelToolTip = Finale
saveButton = Salva
saveButtonToolTip = Salva
validationsButton = Validazioni
validationsButtonToolTip = Validazioni
resourcesButton = Risorse
resourcesButtonToolTip = Risorse

View File

@ -0,0 +1,4 @@
<!-- file: ./IconButton.html -->
<div class="{style.iconButton}">
<div class="{style.iconButtonImage}"></div>
</div>

View File

@ -0,0 +1,17 @@
@CHARSET "UTF-8";
.iconButton {
border: none;
font-size: 12px;
margin: 0px;
padding: 0px;
}
.iconButton .iconButtonImage {
vertical-align: center;
}
.iconButtonRef {
vertical-align: center;
cursor: pointer;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB