|
|
|
@ -59,8 +59,8 @@ public class WriteMessage extends Composite {
|
|
|
|
|
@UiField MaterialAutoComplete acModal;
|
|
|
|
|
@UiField MaterialButton btnSendModal, btnCloseModal;
|
|
|
|
|
@UiField MaterialPanel modalContent, sendingLoader;
|
|
|
|
|
// @UiField MaterialRow attachmentsRow;
|
|
|
|
|
// @UiField MaterialLink attachButton;
|
|
|
|
|
@UiField MaterialRow attachmentsRow;
|
|
|
|
|
@UiField MaterialLink attachButton;
|
|
|
|
|
@UiField MaterialLabel sendingFeedback;
|
|
|
|
|
@UiField MaterialPreLoader sendingSpinner;
|
|
|
|
|
@UiField MaterialTextArea txtArea;
|
|
|
|
@ -205,39 +205,39 @@ public class WriteMessage extends Composite {
|
|
|
|
|
toReturn.add(new WSUser("testing", "username testing", "Andrea testing", "@gmail.com"));
|
|
|
|
|
return toReturn;
|
|
|
|
|
}
|
|
|
|
|
// @UiHandler("attachButton")
|
|
|
|
|
// void onAttach(ClickEvent e) {
|
|
|
|
|
// List<ItemType> types = new ArrayList<>();
|
|
|
|
|
// ItemType[] theTypes = ItemType.values();
|
|
|
|
|
// for (int i = 0; i < theTypes.length; i++) {
|
|
|
|
|
// if (theTypes[i] != ItemType.FOLDER)
|
|
|
|
|
// types.add(theTypes[i]);
|
|
|
|
|
// }
|
|
|
|
|
// FilterCriteria criteria = null;
|
|
|
|
|
// final WorkspaceExplorerSelectDialog wpTreepopup = new WorkspaceExplorerSelectDialog("Select an item", criteria, types);
|
|
|
|
|
// wpTreepopup.setId(Utils.ID_MODALBOOTSTRAP);
|
|
|
|
|
// wpTreepopup.getElement().getStyle().setLeft(50, Unit.PCT);
|
|
|
|
|
// wpTreepopup.setZIndex(10010);
|
|
|
|
|
// WorskpaceExplorerSelectNotificationListener listener = new WorskpaceExplorerSelectNotificationListener() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onSelectedItem(Item item) {
|
|
|
|
|
// attachmentsRow.add(getChip(item.getId(), item.getName(), item.isFolder(), true));
|
|
|
|
|
// wpTreepopup.hide();
|
|
|
|
|
// }
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onFailed(Throwable throwable) {
|
|
|
|
|
// Window.alert("There are networks problem, please check your connection.");
|
|
|
|
|
// }
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onAborted() {}
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onNotValidSelection() {
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// wpTreepopup.addWorkspaceExplorerSelectNotificationListener(listener);
|
|
|
|
|
// wpTreepopup.show();
|
|
|
|
|
// }
|
|
|
|
|
@UiHandler("attachButton")
|
|
|
|
|
void onAttach(ClickEvent e) {
|
|
|
|
|
List<ItemType> types = new ArrayList<>();
|
|
|
|
|
ItemType[] theTypes = ItemType.values();
|
|
|
|
|
for (int i = 0; i < theTypes.length; i++) {
|
|
|
|
|
if (theTypes[i] != ItemType.FOLDER)
|
|
|
|
|
types.add(theTypes[i]);
|
|
|
|
|
}
|
|
|
|
|
FilterCriteria criteria = null;
|
|
|
|
|
final WorkspaceExplorerSelectDialog wpTreepopup = new WorkspaceExplorerSelectDialog("Select an item", criteria, types);
|
|
|
|
|
wpTreepopup.setId(Utils.ID_MODALBOOTSTRAP);
|
|
|
|
|
wpTreepopup.getElement().getStyle().setLeft(50, Unit.PCT);
|
|
|
|
|
wpTreepopup.setZIndex(10010);
|
|
|
|
|
WorskpaceExplorerSelectNotificationListener listener = new WorskpaceExplorerSelectNotificationListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSelectedItem(Item item) {
|
|
|
|
|
attachmentsRow.add(getChip(item.getId(), item.getName(), item.isFolder(), true));
|
|
|
|
|
wpTreepopup.hide();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailed(Throwable throwable) {
|
|
|
|
|
Window.alert("There are networks problem, please check your connection.");
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void onAborted() {}
|
|
|
|
|
@Override
|
|
|
|
|
public void onNotValidSelection() {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
wpTreepopup.addWorkspaceExplorerSelectNotificationListener(listener);
|
|
|
|
|
wpTreepopup.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//for the attachments we distinguish between folder and files
|
|
|
|
|
private MaterialChip getChip(String itemId, String itemName, boolean isFolder, boolean deletable) {
|
|
|
|
@ -263,13 +263,13 @@ public class WriteMessage extends Composite {
|
|
|
|
|
|
|
|
|
|
private ArrayList<String> getSelectedFilesAndFoldersId() {
|
|
|
|
|
ArrayList<String> toReturn = new ArrayList<>();
|
|
|
|
|
// int n = attachmentsRow.getWidgetCount();
|
|
|
|
|
// for (int i = 0; i < n; i++) {
|
|
|
|
|
// Widget w = attachmentsRow.getWidget(i);
|
|
|
|
|
// if (w instanceof MaterialChip) {
|
|
|
|
|
// toReturn.add(((MaterialChip) w).getId());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
int n = attachmentsRow.getWidgetCount();
|
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
|
|
Widget w = attachmentsRow.getWidget(i);
|
|
|
|
|
if (w instanceof MaterialChip) {
|
|
|
|
|
toReturn.add(((MaterialChip) w).getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return toReturn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -297,6 +297,7 @@ public class WriteMessage extends Composite {
|
|
|
|
|
txtArea.reset();
|
|
|
|
|
}
|
|
|
|
|
GWT.log(getSelectedUsers()+"");
|
|
|
|
|
GWT.log(getSelectedFilesAndFoldersId()+"");
|
|
|
|
|
ArrayList<String> recipientIds = new ArrayList<>();
|
|
|
|
|
for (WSUser u : getSelectedUsers()) {
|
|
|
|
|
recipientIds.add(u.getScreenname());
|
|
|
|
|