added tooltip when displaying contact name to Contact Panel
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@96298 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
462f4927de
commit
e533deb3d4
|
@ -38,6 +38,7 @@ import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
|
|||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||
import com.extjs.gxt.ui.client.widget.layout.RowData;
|
||||
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
|
||||
import com.extjs.gxt.ui.client.widget.tips.QuickTip;
|
||||
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||
|
||||
public class MultiDragContact extends Dialog {
|
||||
|
@ -49,6 +50,7 @@ public class MultiDragContact extends Dialog {
|
|||
private TextArea textAreaAlreadyShared;
|
||||
private Grid<ExtendedInfoContactModel> gridAllContacts;
|
||||
private Grid<ExtendedInfoContactModel> gridShareWith;
|
||||
private ColumnConfig columnConfigDisplayName;
|
||||
|
||||
public MultiDragContact() {
|
||||
setStyleAttribute("margin", "10px");
|
||||
|
@ -123,8 +125,27 @@ public class MultiDragContact extends Dialog {
|
|||
VerticalPanel vp = new VerticalPanel();
|
||||
vp.setHorizontalAlign(HorizontalAlignment.CENTER);
|
||||
vp.add(new Label("All Contacts"));
|
||||
|
||||
gridAllContacts = new Grid<ExtendedInfoContactModel>(storeSource, createColumnModel());
|
||||
|
||||
|
||||
GridCellRenderer<ExtendedInfoContactModel> displayNameCellRender = new GridCellRenderer<ExtendedInfoContactModel>() {
|
||||
public String render(ExtendedInfoContactModel model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ExtendedInfoContactModel> store, Grid<ExtendedInfoContactModel> grid) {
|
||||
|
||||
if(model!=null){
|
||||
|
||||
String value = model.get (property);
|
||||
if (value != null){
|
||||
return "<span qtitle='' qtip='" + model.getLogin() +"'>" + value + "</span>";
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
columnConfigDisplayName.setRenderer(displayNameCellRender);
|
||||
|
||||
storeSource.setDefaultSort(InfoContactModel.FULLNAME, SortDir.ASC);
|
||||
storeSource.sort(InfoContactModel.FULLNAME, SortDir.ASC);
|
||||
|
||||
|
@ -244,7 +265,11 @@ public class MultiDragContact extends Dialog {
|
|||
public void componentSelected(ButtonEvent ce) {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// needed to enable quicktips (qtitle for the heading and qtip for the
|
||||
// content) that are setup in the change GridCellRenderer
|
||||
new QuickTip(gridAllContacts);
|
||||
}
|
||||
|
||||
private ColumnModel createColumnModel() {
|
||||
|
@ -253,8 +278,8 @@ public class MultiDragContact extends Dialog {
|
|||
ColumnConfig icon = new ColumnConfig(ExtendedInfoContactModel.ICON, "", 25);
|
||||
configs.add(icon);
|
||||
|
||||
ColumnConfig columnName = new ColumnConfig(ExtendedInfoContactModel.FULLNAME, "Name", 150);
|
||||
configs.add(columnName);
|
||||
columnConfigDisplayName = new ColumnConfig(ExtendedInfoContactModel.FULLNAME, "Name", 150);
|
||||
configs.add(columnConfigDisplayName);
|
||||
|
||||
ColumnConfig type = new ColumnConfig(ExtendedInfoContactModel.ISGROUP, "Type", 50);
|
||||
configs.add(type);
|
||||
|
|
Loading…
Reference in New Issue