Minor glitch fixed to Liferay 6.2

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@128955 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-06-01 12:54:38 +00:00
parent 916c472009
commit 9aa990a944
1 changed files with 215 additions and 142 deletions

View File

@ -48,11 +48,28 @@ 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;
/**
* The Class MultiDragContact.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 1, 2016
*/
public class MultiDragContact extends Dialog {
/**
*
*/
private static final int HEIGHT_CONTAINER_GRID = 395;
/**
*
*/
private static final int HEIGHT_CONTAINER_TEXT_AREA = 72;
private static final int HEIGHT_TEXT_AREA = 55;
private static final int WIDTH_CP = 597;
private static final int HEIGHT_DIALOG = 542;
private static final int WIDTH_DIALOG = 625;
// private static final int HEIGHT_DIALOG = 542;
private static final int HEIGHT_DIALOG = 580;
private static final int WIDTH_DIALOG = 630;
// private static final int WIDTH_DIALOG = 625;
private static final int HEIGHT_GRID = 310;
private GridDropTarget dropSource;
@ -68,6 +85,9 @@ public class MultiDragContact extends Dialog {
private Button buttonAllRight;
private Button buttonAllLeft;
/**
* Instantiates a new multi drag contact.
*/
public MultiDragContact() {
setStyleAttribute("margin", "10px");
setSize(WIDTH_DIALOG, HEIGHT_DIALOG);
@ -87,7 +107,7 @@ public class MultiDragContact extends Dialog {
ContentPanel cpAlreadyShared = new ContentPanel();
cpAlreadyShared.setSize(WIDTH_CP, 60);
cpAlreadyShared.setSize(WIDTH_CP, HEIGHT_CONTAINER_TEXT_AREA);
cpAlreadyShared.setHeaderVisible(false);
cpAlreadyShared.setLayout(new FitLayout());
@ -104,13 +124,14 @@ public class MultiDragContact extends Dialog {
// textField.setFieldLabel("Already shared with");
// textField.setHeight(30);
textAreaAlreadyShared.setWidth(501);
textAreaAlreadyShared.setHeight(43);
textAreaAlreadyShared.setHeight(HEIGHT_TEXT_AREA);
cpAlreadyShared.setStyleAttribute("padding-bottom", "5px");
textAreaAlreadyShared.setReadOnly(true);
cpAlreadyShared.add(textAreaAlreadyShared);
Label label = new Label("Already shared with");
label.setStyleAttribute("padding-right", "10px");
label.setStyleAttribute("font-size", "12px");
hpSharedContacts.add(label);
hpSharedContacts.add(textAreaAlreadyShared);
@ -120,7 +141,7 @@ public class MultiDragContact extends Dialog {
final ContentPanel cp = new ContentPanel();
cp.setSize(WIDTH_CP, 370);
cp.setSize(WIDTH_CP, HEIGHT_CONTAINER_GRID);
cp.setHeaderVisible(false);
cp.setLayout(new RowLayout(Orientation.HORIZONTAL));
@ -323,6 +344,11 @@ public class MultiDragContact extends Dialog {
new QuickTip(gridAllContacts);
}
/**
* Creates the move contacts container.
*
* @return the layout container
*/
private LayoutContainer createMoveContactsContainer() {
LayoutContainer lc = new LayoutContainer();
@ -444,6 +470,11 @@ public class MultiDragContact extends Dialog {
return lc;
}
/**
* Creates the column model.
*
* @return the column model
*/
private ColumnModel createColumnModel() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
@ -478,6 +509,11 @@ public class MultiDragContact extends Dialog {
return new ColumnModel(configs);
}
/**
* Adds the source contacts.
*
* @param listContact the list contact
*/
public void addSourceContacts(List<InfoContactModel> listContact){
gridAllContacts.mask("", ConstantsExplorer.LOADINGSTYLE);
@ -498,6 +534,11 @@ public class MultiDragContact extends Dialog {
gridAllContacts.repaint();
}
/**
* Adds the already shared contacts.
*
* @param listContact the list contact
*/
public void addAlreadySharedContacts(List<InfoContactModel> listContact){
gridShareWith.mask("", ConstantsExplorer.LOADINGSTYLE);
@ -515,12 +556,23 @@ public class MultiDragContact extends Dialog {
}
/**
* Adds the target contacts.
*
* @param listContact the list contact
*/
public void addTargetContacts(List<InfoContactModel> listContact){
if(listContact!=null && listContact.size()>0){
storeTarget.add(convertFromInfoContactModel(listContact));
}
}
/**
* Convert from info contact model.
*
* @param listContact the list contact
* @return the list
*/
private List<ExtendedInfoContactModel> convertFromInfoContactModel(List<InfoContactModel> listContact){
if(listContact!=null){
@ -534,6 +586,12 @@ public class MultiDragContact extends Dialog {
return new ArrayList<ExtendedInfoContactModel>();
}
/**
* Convert from info contact model.
*
* @param infoContactModel the info contact model
* @return the extended info contact model
*/
private ExtendedInfoContactModel convertFromInfoContactModel(InfoContactModel infoContactModel){
if(infoContactModel!=null){
String fullName = infoContactModel.getName();
@ -547,11 +605,21 @@ public class MultiDragContact extends Dialog {
return new ExtendedInfoContactModel();
}
/**
* Adds the target contact.
*
* @param contact the contact
*/
public void addTargetContact(InfoContactModel contact){
if(contact!=null)
storeTarget.add(convertFromInfoContactModel(contact));
}
/**
* Gets the target list contact.
*
* @return the target list contact
*/
public List<InfoContactModel> getTargetListContact(){
List<? extends InfoContactModel> infoContacts = storeTarget.getModels();
@ -559,6 +627,11 @@ public class MultiDragContact extends Dialog {
}
/**
* Sets the grop user store sorter.
*
* @param store the new grop user store sorter
*/
private void setGropUserStoreSorter(ListStore<ExtendedInfoContactModel> store){
// Sorting files