Added auto-complete off
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@128970 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9aa990a944
commit
1752abcd8e
|
@ -42,10 +42,6 @@ import com.google.gwt.user.client.ui.Label;
|
|||
*/
|
||||
public class DialogShareFolder extends Dialog {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
private int widthDialog = 535;
|
||||
private int heightTextArea = 100;
|
||||
private TextField<String> txtName;
|
||||
|
@ -75,7 +71,6 @@ public class DialogShareFolder extends Dialog {
|
|||
|
||||
setWidth(widthDialog);
|
||||
setButtons(Dialog.OKCANCEL);
|
||||
|
||||
setHeading("Share folder: "+folder.getName());
|
||||
|
||||
txtName = new TextField<String>();
|
||||
|
@ -95,9 +90,7 @@ public class DialogShareFolder extends Dialog {
|
|||
textAreaDescription.setFieldLabel(ConstantsExplorer.DIALOG_DESCRIPTION);
|
||||
textAreaDescription.setHeight(heightTextArea);
|
||||
textAreaDescription.setWidth(380);
|
||||
|
||||
textAreaDescription.setValue(folder.getDescription());
|
||||
// textAreaDescription.setReadOnly(true);
|
||||
|
||||
final LayoutContainer lc = new LayoutContainer();
|
||||
lc.setStyleAttribute("margin-top", "10px");
|
||||
|
|
|
@ -105,11 +105,9 @@ public class MultiDragContact extends Dialog {
|
|||
setGropUserStoreSorter(storeSource);
|
||||
setGropUserStoreSorter(storeTarget);
|
||||
|
||||
|
||||
ContentPanel cpAlreadyShared = new ContentPanel();
|
||||
cpAlreadyShared.setSize(WIDTH_CP, HEIGHT_CONTAINER_TEXT_AREA);
|
||||
cpAlreadyShared.setHeaderVisible(false);
|
||||
|
||||
cpAlreadyShared.setLayout(new FitLayout());
|
||||
|
||||
VerticalPanel vpShared = new VerticalPanel();
|
||||
|
|
|
@ -22,11 +22,13 @@ import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
|
|||
import com.google.gwt.user.client.ui.SuggestBox;
|
||||
import com.google.gwt.user.client.ui.SuggestOracle;
|
||||
import com.google.gwt.user.client.ui.TextBox;
|
||||
|
||||
/**
|
||||
* The Class MultiValuePanel.
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
* @version 0.2 Gen 2013 modified by Francesco Mangiacrapa
|
||||
* Facebook style autocompleter
|
||||
*
|
||||
*/
|
||||
public class MultiValuePanel extends Composite {
|
||||
|
||||
|
@ -41,6 +43,7 @@ public class MultiValuePanel extends Composite {
|
|||
private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
|
||||
|
||||
/**
|
||||
* Instantiates a new multi value panel.
|
||||
*
|
||||
* @param userFetch the ContactFetcher
|
||||
*/
|
||||
|
@ -51,9 +54,10 @@ public class MultiValuePanel extends Composite {
|
|||
listBullet.setStyleName("multivalue-panel-suggest");
|
||||
final ListItem item = new ListItem();
|
||||
final TextBox itemBox = new TextBox();
|
||||
itemBox.getElement().setAttribute("autocomplete", "off");
|
||||
itemBox.getElement().setAttribute("style", "outline-color: -moz-use-text-color; outline-style: none; outline-width: medium; border: none;");
|
||||
box = new SuggestBox(getSuggestions(), itemBox);
|
||||
|
||||
box = new SuggestBox(getSuggestions(), itemBox);
|
||||
item.add(box);
|
||||
listBullet.add(item);
|
||||
|
||||
|
@ -70,7 +74,7 @@ public class MultiValuePanel extends Composite {
|
|||
if(li.getWidget(0) instanceof Paragraph){
|
||||
Paragraph p = (Paragraph) li.getWidget(0);
|
||||
// GWT.log("p "+p.getText() +" is removable : " + p.isRemovable());
|
||||
if (itemsSelected.contains(p.getText()) && (p.isRemovable()==true)) {
|
||||
if (itemsSelected.contains(p.getText()) && p.isRemovable()==true) {
|
||||
itemsSelected.remove(p.getText());
|
||||
GWT.log("Removing selected item: " + p.getText() + "'");
|
||||
listBullet.remove(li);
|
||||
|
@ -93,22 +97,30 @@ public class MultiValuePanel extends Composite {
|
|||
panel.add(listBullet);
|
||||
box.getElement().setId("suggestion_box"); //needed for the focus on click
|
||||
panel.getElement().setAttribute("onclick", "document.getElementById('suggestion_box').focus()");
|
||||
// box.setFocus(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Box set focus.
|
||||
*/
|
||||
public void boxSetFocus(){
|
||||
box.getElement().focus();
|
||||
box.setFocus(true);
|
||||
// panel.getElement().setAttribute("onclick", "document.getElementById('suggestion_box').focus()");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the flow panel.
|
||||
*
|
||||
* @return the flow panel
|
||||
*/
|
||||
public FlowPanel getFlowPanel(){
|
||||
return panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* actually insert the contact in the flow panel
|
||||
* @param itemBox
|
||||
* @param list
|
||||
* actually insert the contact in the flow panel.
|
||||
*
|
||||
* @param itemBox the item box
|
||||
* @param list the list
|
||||
*/
|
||||
private void chosenContactItem(final TextBox itemBox, final BulletList list) {
|
||||
if (itemBox.getValue() != null && !"".equals(itemBox.getValue().trim())) {
|
||||
|
@ -136,7 +148,9 @@ public class MultiValuePanel extends Composite {
|
|||
itemBox.setFocus(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the selected user.
|
||||
*
|
||||
* @return the selected contacts (user logins e.g. pino.pini)
|
||||
*/
|
||||
|
@ -156,6 +170,12 @@ public class MultiValuePanel extends Composite {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the list item.
|
||||
*
|
||||
* @param displayItem the display item
|
||||
* @param list the list
|
||||
*/
|
||||
private void removeListItem(ListItem displayItem, BulletList list) {
|
||||
GWT.log("Removing: " + displayItem.getWidget(0).getElement().getInnerHTML(), null);
|
||||
itemsSelected.remove(displayItem.getWidget(0).getElement().getInnerHTML());
|
||||
|
@ -163,28 +183,30 @@ public class MultiValuePanel extends Composite {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the suggestions.
|
||||
*
|
||||
* @return names of possible contacts
|
||||
*/
|
||||
private MultiWordSuggestOracle getSuggestions() {
|
||||
|
||||
userFetch.getListContact(contacts, false);
|
||||
|
||||
return oracle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update suggestions.
|
||||
*
|
||||
* @param result the result
|
||||
*/
|
||||
public void updateSuggestions(List<InfoContactModel> result) {
|
||||
|
||||
oracle.clear();
|
||||
|
||||
for (InfoContactModel wsUser : result) {
|
||||
oracle.add(wsUser.getName());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private AsyncCallback<List<InfoContactModel>> contacts = new AsyncCallback<List<InfoContactModel>>() {
|
||||
|
||||
|
||||
|
@ -206,6 +228,9 @@ public class MultiValuePanel extends Composite {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Reset item selected.
|
||||
*/
|
||||
public void resetItemSelected(){
|
||||
|
||||
listBullet.clear();
|
||||
|
@ -217,9 +242,10 @@ public class MultiValuePanel extends Composite {
|
|||
|
||||
|
||||
/**
|
||||
* Adds the recipient.
|
||||
*
|
||||
* @param contact
|
||||
* @param displayRemoveItem
|
||||
* @param fullName the full name
|
||||
* @param displayRemoveItem the display remove item
|
||||
*/
|
||||
public void addRecipient(String fullName, boolean displayRemoveItem) {
|
||||
|
||||
|
@ -263,10 +289,18 @@ public class MultiValuePanel extends Composite {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear list.
|
||||
*/
|
||||
public void clearList() {
|
||||
listBullet.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the box.
|
||||
*
|
||||
* @return the box
|
||||
*/
|
||||
public SuggestBox getBox() {
|
||||
return box;
|
||||
|
||||
|
|
Loading…
Reference in New Issue