Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@93502 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-25 10:15:58 +00:00 committed by Giancarlo Panichi
parent 16a869a8b4
commit 219c63d754
2 changed files with 35 additions and 26 deletions

View File

@ -211,24 +211,22 @@ public class TemplateApplyPanel extends FramedPanel {
}
/*protected void setMenu() {
Menu contextMenu = new Menu();
MenuItem deleteTemplateItem = new MenuItem("Delete");
deleteTemplateItem.setId("DeleteTemplate");
deleteTemplateItem.setIcon(ResourceBundle.INSTANCE.removeTemplate());
deleteTemplateItem.addSelectionHandler(new SelectionHandler<Item>() {
@Override
public void onSelection(SelectionEvent<Item> event) {
Log.debug("Delete Template");
TemplateData templateDesc = getSelectedItem();
}
});
grid.setContextMenu(contextMenu);
}*/
/*
* protected void setMenu() { Menu contextMenu = new Menu();
*
* MenuItem deleteTemplateItem = new MenuItem("Delete");
* deleteTemplateItem.setId("DeleteTemplate");
* deleteTemplateItem.setIcon(ResourceBundle.INSTANCE.removeTemplate());
* deleteTemplateItem.addSelectionHandler(new SelectionHandler<Item>() {
*
* @Override public void onSelection(SelectionEvent<Item> event) {
* Log.debug("Delete Template"); TemplateData templateDesc =
* getSelectedItem();
*
* } });
*
* grid.setContextMenu(contextMenu); }
*/
protected TemplateData getSelectedItem() {
return grid.getSelectionModel().getSelectedItem();
@ -236,11 +234,15 @@ public class TemplateApplyPanel extends FramedPanel {
protected void apply() {
templateApplySession = new TemplateApplySession();
TemplateData template = getSelectedItem();
if (template == null) {
UtilsGXT3.info("Attention", "Select the template to apply");
} else {
templateApplySession.setTemplateData(getSelectedItem());
templateApplySession.setTrId(trId);
Log.debug("applyTemplateSession: " + templateApplySession);
parent.applyTemplate(templateApplySession);
}
}
protected void close() {

View File

@ -237,12 +237,19 @@ public class TemplateDeletePanel extends FramedPanel {
protected void delete() {
templateDeleteSession = new TemplateDeleteSession();
ArrayList<TemplateData> templates=getSelectedItem();
if(templates==null|| templates.size()==0){
UtilsGXT3.info("Attention",
"Select the template to be deleted");
} else {
templateDeleteSession.setTemplates(getSelectedItem());
Log.debug("templateDeleteSession: " + templateDeleteSession);
parent.templatesDelete(templateDeleteSession);
}
}
protected void close() {
parent.close();
}