|
|
|
@ -66,10 +66,10 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
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 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 WIDTH_DIALOG = 625;
|
|
|
|
|
private static final int HEIGHT_GRID = 310;
|
|
|
|
|
|
|
|
|
|
private GridDropTarget dropSource;
|
|
|
|
@ -101,7 +101,7 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
setResizable(true);
|
|
|
|
|
setButtonAlign(HorizontalAlignment.CENTER);
|
|
|
|
|
setButtons(Dialog.OKCANCEL);
|
|
|
|
|
//SORTING STORE
|
|
|
|
|
// SORTING STORE
|
|
|
|
|
setGropUserStoreSorter(storeSource);
|
|
|
|
|
setGropUserStoreSorter(storeTarget);
|
|
|
|
|
|
|
|
|
@ -119,8 +119,8 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
hpSharedContacts.setHorizontalAlign(HorizontalAlignment.CENTER);
|
|
|
|
|
hpSharedContacts.setVerticalAlign(VerticalAlignment.MIDDLE);
|
|
|
|
|
textAreaAlreadyShared = new TextArea();
|
|
|
|
|
// textField.setFieldLabel("Already shared with");
|
|
|
|
|
// textField.setHeight(30);
|
|
|
|
|
// textField.setFieldLabel("Already shared with");
|
|
|
|
|
// textField.setHeight(30);
|
|
|
|
|
textAreaAlreadyShared.setWidth(501);
|
|
|
|
|
textAreaAlreadyShared.setHeight(HEIGHT_TEXT_AREA);
|
|
|
|
|
cpAlreadyShared.setStyleAttribute("padding-bottom", "5px");
|
|
|
|
@ -137,7 +137,6 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
cpAlreadyShared.add(vpShared);
|
|
|
|
|
add(cpAlreadyShared);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final ContentPanel cp = new ContentPanel();
|
|
|
|
|
cp.setSize(WIDTH_CP, HEIGHT_CONTAINER_GRID);
|
|
|
|
|
cp.setHeaderVisible(false);
|
|
|
|
@ -151,7 +150,9 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void componentSelected(ButtonEvent ce) {
|
|
|
|
|
MessageBox.info("Group dragging action", "Drag one or more contacts from the left (All Contacts) to the right (Share with) to add users in your sharing list.", null);
|
|
|
|
|
MessageBox.info("Group dragging action",
|
|
|
|
|
"Drag one or more contacts from the left (All Contacts) to the right (Share with) to add users in your sharing list.",
|
|
|
|
|
null);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -165,15 +166,15 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
public String render(ExtendedInfoContactModel model, String property, ColumnData config, int rowIndex,
|
|
|
|
|
int colIndex, ListStore<ExtendedInfoContactModel> store, Grid<ExtendedInfoContactModel> grid) {
|
|
|
|
|
|
|
|
|
|
if(model!=null){
|
|
|
|
|
if (model != null) {
|
|
|
|
|
|
|
|
|
|
String value = model.get (property);
|
|
|
|
|
if (value != null){
|
|
|
|
|
return "<span qtitle='' qtip='" + model.getLogin() +"'>" + value + "</span>";
|
|
|
|
|
String value = model.get(property);
|
|
|
|
|
if (value != null) {
|
|
|
|
|
return "<span qtitle='' qtip='" + model.getLogin() + "'>" + value + "</span>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -189,13 +190,11 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
storeTarget.setDefaultSort(InfoContactModel.FULLNAME, SortDir.ASC);
|
|
|
|
|
storeTarget.sort(InfoContactModel.FULLNAME, SortDir.ASC);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final StoreFilterField<ExtendedInfoContactModel> filter = new StoreFilterField<ExtendedInfoContactModel>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean doSelect(Store<ExtendedInfoContactModel> store,
|
|
|
|
|
ExtendedInfoContactModel parent, ExtendedInfoContactModel record,
|
|
|
|
|
String property, String filter) {
|
|
|
|
|
protected boolean doSelect(Store<ExtendedInfoContactModel> store, ExtendedInfoContactModel parent,
|
|
|
|
|
ExtendedInfoContactModel record, String property, String filter) {
|
|
|
|
|
|
|
|
|
|
String name = record.getName();
|
|
|
|
|
name = name.toLowerCase();
|
|
|
|
@ -242,9 +241,8 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
final StoreFilterField<ExtendedInfoContactModel> filter2 = new StoreFilterField<ExtendedInfoContactModel>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean doSelect(Store<ExtendedInfoContactModel> store,
|
|
|
|
|
ExtendedInfoContactModel parent, ExtendedInfoContactModel record,
|
|
|
|
|
String property, String filter) {
|
|
|
|
|
protected boolean doSelect(Store<ExtendedInfoContactModel> store, ExtendedInfoContactModel parent,
|
|
|
|
|
ExtendedInfoContactModel record, String property, String filter) {
|
|
|
|
|
|
|
|
|
|
String name = record.getName();
|
|
|
|
|
name = name.toLowerCase();
|
|
|
|
@ -267,7 +265,7 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
gridShareWith.setHeight(HEIGHT_GRID);
|
|
|
|
|
gridShareWith.setBorders(false);
|
|
|
|
|
gridShareWith.getView().setAutoFill(true);
|
|
|
|
|
// gridShareWith.setAutoExpandColumn(InfoContactModel.FULLNAME);
|
|
|
|
|
// gridShareWith.setAutoExpandColumn(InfoContactModel.FULLNAME);
|
|
|
|
|
gridShareWith.setBorders(true);
|
|
|
|
|
vpShareWith.add(hp);
|
|
|
|
|
vpShareWith.add(gridShareWith);
|
|
|
|
@ -293,28 +291,28 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void componentSelected(ButtonEvent ce) {
|
|
|
|
|
List<ExtendedInfoContactModel> shareContacts = storeTarget.getModels();
|
|
|
|
|
|
|
|
|
|
if(shareContacts==null || shareContacts.isEmpty()){
|
|
|
|
|
if (shareContacts == null || shareContacts.isEmpty()) {
|
|
|
|
|
|
|
|
|
|
MessageBoxConfirm mbc = new MessageBoxConfirm("Confirm exit?", "You have not selected any contact to share, confirm exit?");
|
|
|
|
|
MessageBoxConfirm mbc = new MessageBoxConfirm("Confirm exit?",
|
|
|
|
|
"You have not selected any contact to share, confirm exit?");
|
|
|
|
|
|
|
|
|
|
mbc.getMessageBoxConfirm().addCallback(new Listener<MessageBoxEvent>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void handleEvent(MessageBoxEvent be) {
|
|
|
|
|
String clickedButton = be.getButtonClicked().getItemId();
|
|
|
|
|
if(clickedButton.equals(Dialog.YES)){
|
|
|
|
|
if (clickedButton.equals(Dialog.YES)) {
|
|
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else
|
|
|
|
|
} else
|
|
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -327,12 +325,12 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
@Override
|
|
|
|
|
public void handleEvent(BaseEvent be) {
|
|
|
|
|
int width = gridAllContacts.getWidth();
|
|
|
|
|
filter.setWidth(width-2);
|
|
|
|
|
filter2.setWidth(width-2);
|
|
|
|
|
gridShareWith.setWidth(width+5);
|
|
|
|
|
vpShareWith.setWidth(width+15);
|
|
|
|
|
gridAllContacts.setWidth(width+5);
|
|
|
|
|
vpAllContacts.setWidth(width+15);
|
|
|
|
|
filter.setWidth(width - 2);
|
|
|
|
|
filter2.setWidth(width - 2);
|
|
|
|
|
gridShareWith.setWidth(width + 5);
|
|
|
|
|
vpShareWith.setWidth(width + 15);
|
|
|
|
|
gridAllContacts.setWidth(width + 5);
|
|
|
|
|
vpAllContacts.setWidth(width + 15);
|
|
|
|
|
vpShareWith.layout();
|
|
|
|
|
vpAllContacts.layout();
|
|
|
|
|
cp.layout();
|
|
|
|
@ -357,16 +355,13 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
|
|
|
|
|
buttonSelectedLeft = new Button();
|
|
|
|
|
buttonSelectedLeft.setIcon(Resources.getSelectedLeft());
|
|
|
|
|
buttonSelectedLeft
|
|
|
|
|
.setToolTip("Move selected contact/s from 'All Contact' to 'Share with'");
|
|
|
|
|
buttonSelectedLeft
|
|
|
|
|
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
buttonSelectedLeft.setToolTip("Move selected contact/s from 'All Contact' to 'Share with'");
|
|
|
|
|
buttonSelectedLeft.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void componentSelected(ButtonEvent ce) {
|
|
|
|
|
|
|
|
|
|
List<ExtendedInfoContactModel> selectedItems = gridAllContacts
|
|
|
|
|
.getSelectionModel().getSelectedItems();
|
|
|
|
|
List<ExtendedInfoContactModel> selectedItems = gridAllContacts.getSelectionModel().getSelectedItems();
|
|
|
|
|
|
|
|
|
|
if (selectedItems != null && selectedItems.size() > 0) {
|
|
|
|
|
|
|
|
|
@ -380,17 +375,14 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
|
|
|
|
|
buttonSelectedRight = new Button();
|
|
|
|
|
buttonSelectedRight.setIcon(Resources.getSelectedRight());
|
|
|
|
|
buttonSelectedRight
|
|
|
|
|
.setToolTip("Move selected contact/s from 'Share with' to 'All Contact'");
|
|
|
|
|
buttonSelectedRight.setToolTip("Move selected contact/s from 'Share with' to 'All Contact'");
|
|
|
|
|
|
|
|
|
|
buttonSelectedRight
|
|
|
|
|
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
buttonSelectedRight.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void componentSelected(ButtonEvent ce) {
|
|
|
|
|
|
|
|
|
|
List<ExtendedInfoContactModel> selectedItems = gridShareWith
|
|
|
|
|
.getSelectionModel().getSelectedItems();
|
|
|
|
|
List<ExtendedInfoContactModel> selectedItems = gridShareWith.getSelectionModel().getSelectedItems();
|
|
|
|
|
|
|
|
|
|
if (selectedItems != null && selectedItems.size() > 0) {
|
|
|
|
|
|
|
|
|
@ -404,18 +396,15 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
|
|
|
|
|
buttonAllLeft = new Button();
|
|
|
|
|
buttonAllLeft.setIcon(Resources.getAllLeft());
|
|
|
|
|
buttonAllLeft
|
|
|
|
|
.setToolTip("Move all contact/s from 'All Contact' to 'Share with'");
|
|
|
|
|
buttonAllLeft.setToolTip("Move all contact/s from 'All Contact' to 'Share with'");
|
|
|
|
|
|
|
|
|
|
buttonAllLeft
|
|
|
|
|
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
buttonAllLeft.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void componentSelected(ButtonEvent ce) {
|
|
|
|
|
|
|
|
|
|
if (storeSource != null && storeSource.getCount() > 0) {
|
|
|
|
|
for (ExtendedInfoContactModel extendedInfoContactModel : storeSource
|
|
|
|
|
.getModels()) {
|
|
|
|
|
for (ExtendedInfoContactModel extendedInfoContactModel : storeSource.getModels()) {
|
|
|
|
|
storeTarget.add(extendedInfoContactModel);
|
|
|
|
|
storeSource.remove(extendedInfoContactModel);
|
|
|
|
|
}
|
|
|
|
@ -426,18 +415,15 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
|
|
|
|
|
buttonAllRight = new Button();
|
|
|
|
|
buttonAllRight.setIcon(Resources.getAllRight());
|
|
|
|
|
buttonAllRight
|
|
|
|
|
.setToolTip("Move all contact/s from 'Share with' to 'All Contact'");
|
|
|
|
|
buttonAllRight.setToolTip("Move all contact/s from 'Share with' to 'All Contact'");
|
|
|
|
|
|
|
|
|
|
buttonAllRight
|
|
|
|
|
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
buttonAllRight.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void componentSelected(ButtonEvent ce) {
|
|
|
|
|
|
|
|
|
|
if (storeTarget != null && storeTarget.getCount() > 0) {
|
|
|
|
|
for (ExtendedInfoContactModel extendedInfoContactModel : storeTarget
|
|
|
|
|
.getModels()) {
|
|
|
|
|
for (ExtendedInfoContactModel extendedInfoContactModel : storeTarget.getModels()) {
|
|
|
|
|
storeSource.add(extendedInfoContactModel);
|
|
|
|
|
storeTarget.remove(extendedInfoContactModel);
|
|
|
|
|
}
|
|
|
|
@ -485,18 +471,18 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
ColumnConfig type = new ColumnConfig(ExtendedInfoContactModel.ISGROUP, "Type", 50);
|
|
|
|
|
configs.add(type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GridCellRenderer<ExtendedInfoContactModel> typeRender = new GridCellRenderer<ExtendedInfoContactModel>() {
|
|
|
|
|
@Override
|
|
|
|
|
public String render(ExtendedInfoContactModel model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ExtendedInfoContactModel> store, Grid<ExtendedInfoContactModel> grid) {
|
|
|
|
|
public String render(ExtendedInfoContactModel model, String property, ColumnData config, int rowIndex,
|
|
|
|
|
int colIndex, ListStore<ExtendedInfoContactModel> store, Grid<ExtendedInfoContactModel> grid) {
|
|
|
|
|
Boolean isGroup = (Boolean) model.get(property);
|
|
|
|
|
String color = "#0F4FA8";
|
|
|
|
|
String val = "";
|
|
|
|
|
if(isGroup){
|
|
|
|
|
if (isGroup) {
|
|
|
|
|
val = "Group";
|
|
|
|
|
color = "#05316D";
|
|
|
|
|
return "<span style='font-weight: bold; color:" + color + "'>" + val + "</span>";
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
val = "User";
|
|
|
|
|
return "<span style='font-weight: bold; color:" + color + "'>" + val + "</span>";
|
|
|
|
|
}
|
|
|
|
@ -510,22 +496,25 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
/**
|
|
|
|
|
* Adds the source contacts.
|
|
|
|
|
*
|
|
|
|
|
* @param listContact the list contact
|
|
|
|
|
* @param listContact
|
|
|
|
|
* the list contact
|
|
|
|
|
*/
|
|
|
|
|
public void addSourceContacts(List<InfoContactModel> listContact){
|
|
|
|
|
public void addSourceContacts(List<InfoContactModel> listContact) {
|
|
|
|
|
|
|
|
|
|
gridAllContacts.mask("", ConstantsExplorer.LOADINGSTYLE);
|
|
|
|
|
if(listContact!=null && listContact.size()>0){
|
|
|
|
|
if (listContact != null && listContact.size() > 0) {
|
|
|
|
|
List<ExtendedInfoContactModel> listExtended = new ArrayList<ExtendedInfoContactModel>();
|
|
|
|
|
//SETTING ICONS
|
|
|
|
|
// SETTING ICONS
|
|
|
|
|
for (InfoContactModel infoContactModel : listContact) {
|
|
|
|
|
ExtendedInfoContactModel ext = new ExtendedInfoContactModel(infoContactModel.getId(), infoContactModel.getLogin(), infoContactModel.getName(), infoContactModel.isGroup());
|
|
|
|
|
ExtendedInfoContactModel ext = new ExtendedInfoContactModel(infoContactModel.getId(),
|
|
|
|
|
infoContactModel.getLogin(), infoContactModel.getName(), infoContactModel.getEmailDomain(),
|
|
|
|
|
infoContactModel.isGroup());
|
|
|
|
|
ext.setIcon();
|
|
|
|
|
listExtended.add(ext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
storeSource.add(listExtended);
|
|
|
|
|
// GWT.log("Added sources: "+listExtended.toString());
|
|
|
|
|
// GWT.log("Added sources: "+listExtended.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gridAllContacts.unmask();
|
|
|
|
@ -535,18 +524,19 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
/**
|
|
|
|
|
* Adds the already shared contacts.
|
|
|
|
|
*
|
|
|
|
|
* @param listContact the list contact
|
|
|
|
|
* @param listContact
|
|
|
|
|
* the list contact
|
|
|
|
|
*/
|
|
|
|
|
public void addAlreadySharedContacts(List<InfoContactModel> listContact){
|
|
|
|
|
public void addAlreadySharedContacts(List<InfoContactModel> listContact) {
|
|
|
|
|
|
|
|
|
|
gridShareWith.mask("", ConstantsExplorer.LOADINGSTYLE);
|
|
|
|
|
if(listContact!=null && listContact.size()>0){
|
|
|
|
|
if (listContact != null && listContact.size() > 0) {
|
|
|
|
|
|
|
|
|
|
String alreadyShared = "";
|
|
|
|
|
for (int i=0; i<listContact.size()-1; i++)
|
|
|
|
|
alreadyShared+=listContact.get(i).getName()+", ";
|
|
|
|
|
for (int i = 0; i < listContact.size() - 1; i++)
|
|
|
|
|
alreadyShared += listContact.get(i).getName() + ", ";
|
|
|
|
|
|
|
|
|
|
alreadyShared+=listContact.get(listContact.size()-1).getName();
|
|
|
|
|
alreadyShared += listContact.get(listContact.size() - 1).getName();
|
|
|
|
|
|
|
|
|
|
textAreaAlreadyShared.setValue(alreadyShared);
|
|
|
|
|
}
|
|
|
|
@ -557,10 +547,11 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
/**
|
|
|
|
|
* Adds the target contacts.
|
|
|
|
|
*
|
|
|
|
|
* @param listContact the list contact
|
|
|
|
|
* @param listContact
|
|
|
|
|
* the list contact
|
|
|
|
|
*/
|
|
|
|
|
public void addTargetContacts(List<InfoContactModel> listContact){
|
|
|
|
|
if(listContact!=null && listContact.size()>0){
|
|
|
|
|
public void addTargetContacts(List<InfoContactModel> listContact) {
|
|
|
|
|
if (listContact != null && listContact.size() > 0) {
|
|
|
|
|
storeTarget.add(convertFromInfoContactModel(listContact));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -568,14 +559,15 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
/**
|
|
|
|
|
* Convert from info contact model.
|
|
|
|
|
*
|
|
|
|
|
* @param listContact the list contact
|
|
|
|
|
* @param listContact
|
|
|
|
|
* the list contact
|
|
|
|
|
* @return the list
|
|
|
|
|
*/
|
|
|
|
|
private List<ExtendedInfoContactModel> convertFromInfoContactModel(List<InfoContactModel> listContact){
|
|
|
|
|
private List<ExtendedInfoContactModel> convertFromInfoContactModel(List<InfoContactModel> listContact) {
|
|
|
|
|
|
|
|
|
|
if(listContact!=null){
|
|
|
|
|
if (listContact != null) {
|
|
|
|
|
List<ExtendedInfoContactModel> listExtended = new ArrayList<ExtendedInfoContactModel>(listContact.size());
|
|
|
|
|
//SETTING ICONS
|
|
|
|
|
// SETTING ICONS
|
|
|
|
|
for (InfoContactModel infoContactModel : listContact) {
|
|
|
|
|
listExtended.add(convertFromInfoContactModel(infoContactModel));
|
|
|
|
|
}
|
|
|
|
@ -587,16 +579,19 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
/**
|
|
|
|
|
* Convert from info contact model.
|
|
|
|
|
*
|
|
|
|
|
* @param infoContactModel the info contact model
|
|
|
|
|
* @param infoContactModel
|
|
|
|
|
* the info contact model
|
|
|
|
|
* @return the extended info contact model
|
|
|
|
|
*/
|
|
|
|
|
private ExtendedInfoContactModel convertFromInfoContactModel(InfoContactModel infoContactModel){
|
|
|
|
|
if(infoContactModel!=null){
|
|
|
|
|
private ExtendedInfoContactModel convertFromInfoContactModel(InfoContactModel infoContactModel) {
|
|
|
|
|
if (infoContactModel != null) {
|
|
|
|
|
String fullName = infoContactModel.getName();
|
|
|
|
|
if(fullName==null || fullName.isEmpty())
|
|
|
|
|
if (fullName == null || fullName.isEmpty())
|
|
|
|
|
fullName = infoContactModel.getLogin();
|
|
|
|
|
|
|
|
|
|
ExtendedInfoContactModel ext = new ExtendedInfoContactModel(infoContactModel.getId(), infoContactModel.getLogin(), fullName, infoContactModel.isGroup());
|
|
|
|
|
ExtendedInfoContactModel ext = new ExtendedInfoContactModel(infoContactModel.getId(),
|
|
|
|
|
infoContactModel.getLogin(), fullName, infoContactModel.getEmailDomain(),
|
|
|
|
|
infoContactModel.isGroup());
|
|
|
|
|
ext.setIcon();
|
|
|
|
|
return ext;
|
|
|
|
|
}
|
|
|
|
@ -606,10 +601,11 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
/**
|
|
|
|
|
* Adds the target contact.
|
|
|
|
|
*
|
|
|
|
|
* @param contact the contact
|
|
|
|
|
* @param contact
|
|
|
|
|
* the contact
|
|
|
|
|
*/
|
|
|
|
|
public void addTargetContact(InfoContactModel contact){
|
|
|
|
|
if(contact!=null)
|
|
|
|
|
public void addTargetContact(InfoContactModel contact) {
|
|
|
|
|
if (contact != null)
|
|
|
|
|
storeTarget.add(convertFromInfoContactModel(contact));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -618,25 +614,26 @@ public class MultiDragContact extends Dialog {
|
|
|
|
|
*
|
|
|
|
|
* @return the target list contact
|
|
|
|
|
*/
|
|
|
|
|
public List<InfoContactModel> getTargetListContact(){
|
|
|
|
|
public List<InfoContactModel> getTargetListContact() {
|
|
|
|
|
|
|
|
|
|
List<? extends InfoContactModel> infoContacts = storeTarget.getModels();
|
|
|
|
|
return (List<InfoContactModel>) infoContacts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the grop user store sorter.
|
|
|
|
|
*
|
|
|
|
|
* @param store the new grop user store sorter
|
|
|
|
|
* @param store
|
|
|
|
|
* the new grop user store sorter
|
|
|
|
|
*/
|
|
|
|
|
private void setGropUserStoreSorter(ListStore<ExtendedInfoContactModel> store){
|
|
|
|
|
private void setGropUserStoreSorter(ListStore<ExtendedInfoContactModel> store) {
|
|
|
|
|
|
|
|
|
|
// Sorting files
|
|
|
|
|
store.setStoreSorter(new StoreSorter<ExtendedInfoContactModel>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int compare(Store<ExtendedInfoContactModel> store, ExtendedInfoContactModel m1, ExtendedInfoContactModel m2, String property) {
|
|
|
|
|
public int compare(Store<ExtendedInfoContactModel> store, ExtendedInfoContactModel m1,
|
|
|
|
|
ExtendedInfoContactModel m2, String property) {
|
|
|
|
|
boolean m1Folder = m1.isGroup();
|
|
|
|
|
boolean m2Folder = m2.isGroup();
|
|
|
|
|
|
|
|
|
|