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:
parent
f5d142ef6b
commit
2d4c5a5161
|
@ -625,6 +625,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
||||||
// add the button cancel
|
// add the button cancel
|
||||||
Button cancel = new Button("", Images.iconCancel());
|
Button cancel = new Button("", Images.iconCancel());
|
||||||
cancel.setToolTip("Cancel");
|
cancel.setToolTip("Cancel");
|
||||||
|
|
||||||
|
|
||||||
// add Buttons and TextField to the toolbar
|
// add Buttons and TextField to the toolbar
|
||||||
toolBarTop.add(searchTable);
|
toolBarTop.add(searchTable);
|
||||||
|
|
|
@ -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.FileModel;
|
||||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
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.events.SelectedItemEvent;
|
||||||
|
import org.gcube.portlets.user.databasesmanager.client.resources.Images;
|
||||||
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||||
import com.extjs.gxt.ui.client.Style.SelectionMode;
|
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.ComponentEvent;
|
||||||
import com.extjs.gxt.ui.client.event.EventType;
|
import com.extjs.gxt.ui.client.event.EventType;
|
||||||
import com.extjs.gxt.ui.client.event.Events;
|
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.event.shared.HandlerManager;
|
||||||
import com.google.gwt.user.client.Event;
|
import com.google.gwt.user.client.Event;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||||
|
|
||||||
//class that implements the tree object
|
//class that implements the tree object
|
||||||
public class GxtTreePanel extends LayoutContainer {
|
public class GxtTreePanel extends LayoutContainer {
|
||||||
|
@ -118,6 +121,28 @@ public class GxtTreePanel extends LayoutContainer {
|
||||||
};
|
};
|
||||||
|
|
||||||
treePanel.setDisplayProperty("name");
|
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
|
// load the root
|
||||||
loadRootItemTree();
|
loadRootItemTree();
|
||||||
|
|
|
@ -14,5 +14,15 @@ public class Images {
|
||||||
return AbstractImagePrototype.create(DatabasesManager.resources
|
return AbstractImagePrototype.create(DatabasesManager.resources
|
||||||
.iconCancel());
|
.iconCancel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static AbstractImagePrototype iconDatabase() {
|
||||||
|
return AbstractImagePrototype.create(DatabasesManager.resources
|
||||||
|
.iconDatabase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AbstractImagePrototype iconSchema() {
|
||||||
|
return AbstractImagePrototype.create(DatabasesManager.resources
|
||||||
|
.iconSchema());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,18 @@ import com.google.gwt.resources.client.ClientBundle;
|
||||||
import com.google.gwt.resources.client.ImageResource;
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
|
|
||||||
public interface Resources extends ClientBundle {
|
public interface Resources extends ClientBundle {
|
||||||
|
|
||||||
@Source("search.png")
|
@Source("search.png")
|
||||||
ImageResource iconSearch();
|
ImageResource iconSearch();
|
||||||
|
|
||||||
@Source("cancel.png")
|
@Source("cancel.png")
|
||||||
ImageResource iconCancel();
|
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 |
Loading…
Reference in New Issue