icons added in the tree panel for a database and a schema element

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98830 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-07-21 09:26:45 +00:00
parent f5d142ef6b
commit 2d4c5a5161
6 changed files with 44 additions and 0 deletions

View File

@ -625,6 +625,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// add the button cancel
Button cancel = new Button("", Images.iconCancel());
cancel.setToolTip("Cancel");
// add Buttons and TextField to the toolbar
toolBarTop.add(searchTable);

View File

@ -11,9 +11,11 @@ import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerServiceAsync;
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
import org.gcube.portlets.user.databasesmanager.client.events.SelectedItemEvent;
import org.gcube.portlets.user.databasesmanager.client.resources.Images;
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.Style.SelectionMode;
import com.extjs.gxt.ui.client.data.ModelIconProvider;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.event.Events;
@ -30,6 +32,7 @@ import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
//class that implements the tree object
public class GxtTreePanel extends LayoutContainer {
@ -118,6 +121,28 @@ public class GxtTreePanel extends LayoutContainer {
};
treePanel.setDisplayProperty("name");
// set icons in tree panel
treePanel.setIconProvider(new ModelIconProvider<FileModel>() {
@Override
public AbstractImagePrototype getIcon(FileModel model) {
// TODO Auto-generated method stub
if (model.isDatabase()){
return Images.iconDatabase();
}
if (model.isSchema()){
return Images.iconSchema();
}
return null;
}
});
// load the root
loadRootItemTree();

View File

@ -14,5 +14,15 @@ public class Images {
return AbstractImagePrototype.create(DatabasesManager.resources
.iconCancel());
}
public static AbstractImagePrototype iconDatabase() {
return AbstractImagePrototype.create(DatabasesManager.resources
.iconDatabase());
}
public static AbstractImagePrototype iconSchema() {
return AbstractImagePrototype.create(DatabasesManager.resources
.iconSchema());
}
}

View File

@ -4,10 +4,18 @@ import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
public interface Resources extends ClientBundle {
@Source("search.png")
ImageResource iconSearch();
@Source("cancel.png")
ImageResource iconCancel();
@Source("database.png")
ImageResource iconDatabase();
@Source("schema.png")
ImageResource iconSchema();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B