164 lines
4.0 KiB
Java
164 lines
4.0 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.portlets.widgets.workspacesharingwidget.client.view.sharing.admin;
|
|
|
|
import org.gcube.portlets.widgets.workspacesharingwidget.client.resources.Resources;
|
|
|
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
|
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
|
import com.extjs.gxt.ui.client.event.SelectionListener;
|
|
import com.extjs.gxt.ui.client.widget.Dialog;
|
|
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
|
import com.extjs.gxt.ui.client.widget.MessageBox;
|
|
import com.extjs.gxt.ui.client.widget.button.Button;
|
|
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
|
import com.google.gwt.core.client.GWT;
|
|
import com.google.gwt.user.client.Random;
|
|
|
|
/**
|
|
* @author Francesco Mangiacrapa Jan 27, 2015
|
|
*
|
|
*/
|
|
public class DialogMultiDragContactAdmin extends Dialog {
|
|
|
|
private static final String GROUP_DRAGGING_CONTACTS = "Group dragging contacts";
|
|
private static final int HEIGHT_DIALOG = 542;
|
|
private static final int WIDTH_DIALOG = 620;
|
|
|
|
|
|
private String txtHelp = "Drag one or more contacts from the left (All Contacts) to the right (Share with) to add users in your sharing list.";
|
|
private String titleHelp = "Group dragging action";
|
|
|
|
// private boolean hideOnPressOkButton=false;
|
|
private MultiDragContactAdmin multiDragContactAdmin;
|
|
// private boolean visibleTextArea=false;
|
|
|
|
private ToolBar toolBar;
|
|
private String headTitle;
|
|
|
|
private LayoutContainer lcTop = new LayoutContainer();
|
|
private LayoutContainer lcMiddle = new LayoutContainer();
|
|
private LayoutContainer lcBottom = new LayoutContainer();
|
|
|
|
public DialogMultiDragContactAdmin(String headTitle, String leftListContactsTitle, String rightListContactsTitle,
|
|
String workspaceItemId) {
|
|
|
|
GWT.log("DialogMultiDragContactAdmin()");
|
|
try {
|
|
this.headTitle = headTitle;
|
|
this.multiDragContactAdmin = new MultiDragContactAdmin(leftListContactsTitle, rightListContactsTitle,
|
|
workspaceItemId);
|
|
init();
|
|
} catch (Throwable e) {
|
|
GWT.log("Error in DialogMultiDragContactAdmin()" + e.getLocalizedMessage(), e);
|
|
}
|
|
}
|
|
|
|
public void showToolBar(boolean bool) {
|
|
this.toolBar.setVisible(bool);
|
|
}
|
|
|
|
private void init() {
|
|
if (headTitle == null)
|
|
this.setHeading(GROUP_DRAGGING_CONTACTS);
|
|
else
|
|
this.setHeading(headTitle);
|
|
|
|
setId(DialogMultiDragContactAdmin.class.getName() + Random.nextInt());
|
|
setSize(WIDTH_DIALOG, HEIGHT_DIALOG);
|
|
setResizable(false);
|
|
setMaximizable(false);
|
|
setIcon(Resources.getIconUsers());
|
|
setModal(true);
|
|
// setScrollMode(Scroll.AUTOY);
|
|
|
|
// setResizable(true);
|
|
setButtonAlign(HorizontalAlignment.CENTER);
|
|
setButtons(Dialog.OKCANCEL);
|
|
|
|
toolBar = new ToolBar();
|
|
Button buttonHelp = new Button();
|
|
buttonHelp.setIcon(Resources.getIconInfo());
|
|
|
|
buttonHelp.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
@Override
|
|
public void componentSelected(ButtonEvent ce) {
|
|
MessageBox.info(titleHelp, txtHelp, null);
|
|
|
|
}
|
|
});
|
|
|
|
toolBar.add(buttonHelp);
|
|
setTopComponent(toolBar);
|
|
|
|
this.getButtonById(Dialog.CANCEL).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
@Override
|
|
public void componentSelected(ButtonEvent ce) {
|
|
hide();
|
|
}
|
|
});
|
|
|
|
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
|
|
@Override
|
|
public void componentSelected(ButtonEvent ce) {
|
|
hide();
|
|
}
|
|
});
|
|
|
|
lcMiddle.add(multiDragContactAdmin);
|
|
add(lcTop);
|
|
add(lcMiddle);
|
|
add(lcBottom);
|
|
|
|
}
|
|
|
|
public MultiDragContactAdmin getMultiDrag() {
|
|
return multiDragContactAdmin;
|
|
}
|
|
|
|
public String getHeadTitle() {
|
|
return headTitle;
|
|
}
|
|
|
|
public String getTxtHelp() {
|
|
return txtHelp;
|
|
}
|
|
|
|
public String getTitleHelp() {
|
|
return titleHelp;
|
|
}
|
|
|
|
public ToolBar getToolBar() {
|
|
return toolBar;
|
|
}
|
|
|
|
public void setTxtHelp(String txtHelp) {
|
|
this.txtHelp = txtHelp;
|
|
}
|
|
|
|
public void setTitleHelp(String titleHelp) {
|
|
this.titleHelp = titleHelp;
|
|
}
|
|
|
|
public void setToolBar(ToolBar toolBar) {
|
|
this.toolBar = toolBar;
|
|
}
|
|
|
|
public LayoutContainer getLcTop() {
|
|
return lcTop;
|
|
}
|
|
|
|
public LayoutContainer getLcMiddle() {
|
|
return lcMiddle;
|
|
}
|
|
|
|
public LayoutContainer getLcBottom() {
|
|
return lcBottom;
|
|
}
|
|
|
|
}
|