Graphic glitch added to Liferay 6.2

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@128967 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-06-01 14:50:24 +00:00
parent 733aab8758
commit 3eaf0c29da
4 changed files with 171 additions and 164 deletions

View File

@ -60,6 +60,6 @@ public class ConstantsPortlet {
public static final long MILLISECS_PER_DAY = 1000L * 60L * 60L * 24L; public static final long MILLISECS_PER_DAY = 1000L * 60L * 60L * 24L;
public static final int NORTH_HEIGHT = 70; public static final int NORTH_HEIGHT = 77;
} }

View File

@ -110,19 +110,6 @@ public class GxtBasicTabPanel extends LayoutContainer {
txtPath.setStyleAttribute("backgroundColor", "white"); txtPath.setStyleAttribute("backgroundColor", "white");
txtPath.setAutoWidth(true); txtPath.setAutoWidth(true);
// Radio radioTree = new Radio();
// radioTree.setBoxLabel("Tree");
// radioTree.setValue(true);
// radioTree.setValueAttribute(viewSwitchType.TREE.toString());
// Radio radioShortcut = new Radio();
// radioShortcut.setBoxLabel("Shortcut");
// radioShortcut.setValueAttribute(viewSwitchType.SHORTCUT.toString());
// RadioGroup radioGroup = new RadioGroup();
// radioGroup.setFieldLabel("Afecto");
// radioGroup.add(radioTree);
// radioGroup.add(radioShortcut);
// radioGroup.setStyleAttribute("margin-left", "20px");
HorizontalPanel hpPath = new HorizontalPanel(); HorizontalPanel hpPath = new HorizontalPanel();
hpPath.setLayout(new FitLayout()); hpPath.setLayout(new FitLayout());
hpPath.setBorders(true); hpPath.setBorders(true);
@ -148,21 +135,12 @@ public class GxtBasicTabPanel extends LayoutContainer {
@Override @Override
public void selectionChanged(SelectionChangedEvent<ScopeModel> se) { public void selectionChanged(SelectionChangedEvent<ScopeModel> se) {
// Window.alert("selected scope" + se.getSelectedItem().get("name"));
//TODO
} }
}); });
this.cbViewScope.setStyleAttribute("margin-left", "20px"); this.cbViewScope.setStyleAttribute("margin-left", "20px");
hpScope.add(this.cbViewScope); hpScope.add(this.cbViewScope);
// HorizontalPanel hpRadio = new HorizontalPanel();
// hpRadio.setLayout(new FitLayout());
// hpRadio.add(txtSwitch);
// hpRadio.add(radioGroup);
cp.add(hpPath,flex); cp.add(hpPath,flex);
cp.add(hpScope,flex); cp.add(hpScope,flex);
// cp.add(hpRadio, flex); // cp.add(hpRadio, flex);
@ -182,17 +160,13 @@ public class GxtBasicTabPanel extends LayoutContainer {
cp.setBorders(false); cp.setBorders(false);
cp.setBodyBorder(false); cp.setBodyBorder(false);
FormPanel formPanel = new FormPanel(); FormPanel formPanel = new FormPanel();
formPanel.setHeaderVisible(false); formPanel.setHeaderVisible(false);
formPanel.setBodyBorder(false); formPanel.setBodyBorder(false);
// formPanel.setFrame(true); // formPanel.setFrame(true);
formPanel.setWidth(350); formPanel.setWidth(350);
FormData formData = new FormData("-20"); FormData formData = new FormData("-20");
cbNameFilter.setFieldLabel("Name Filter"); cbNameFilter.setFieldLabel("Name Filter");
// combo.setDisplayField("name"); // combo.setDisplayField("name");
formPanel.add(cbNameFilter, formData); formPanel.add(cbNameFilter, formData);
@ -238,7 +212,6 @@ public class GxtBasicTabPanel extends LayoutContainer {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
resetFieldsInTabSearch(); resetFieldsInTabSearch();
} }
}); });
@ -279,7 +252,7 @@ public class GxtBasicTabPanel extends LayoutContainer {
public void setLabelPath(String path){ public void setLabelPath(String path){
if(path != null && (!path.isEmpty())) if(path != null && !path.isEmpty())
this.labelPath.setText(path); this.labelPath.setText(path);
else else
this.labelPath.setText(EMPTY); this.labelPath.setText(EMPTY);

View File

@ -24,20 +24,21 @@ import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox; import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.form.TextField; import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.github.gwtbootstrap.client.ui.Button;
import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.RootPanel;
/** /**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * The Class GxtSeachAndFilterPanel.
* @author Massimiliano Assante ISTI-CNR
* *
* @version 1.0 May 14th 2012 * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 1, 2016
*/ */
public class GxtSeachAndFilterPanel extends LayoutContainer { public class GxtSeachAndFilterPanel extends LayoutContainer {
@ -45,40 +46,35 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
private ComboBox<ScopeModel> cbViewScope = null; private ComboBox<ScopeModel> cbViewScope = null;
private final TextField<String> textSearch = new TextField<String>(); private final TextField<String> textSearch = new TextField<String>();
private Button bSearch = new Button(ConstantsPortlet.SEARCH); private Button bSearch = new Button(ConstantsPortlet.SEARCH);
// private Image bSearchIn = Resources.getIconSearchWs().createImage();
// private HorizontalPanel hpSearchIn = new HorizontalPanel();
// private String searchInFolderId = ""; //is the root
private Button bCancel = new Button(ConstantsPortlet.CANCEL); private Button bCancel = new Button(ConstantsPortlet.CANCEL);
private Button bSave = new Button(ConstantsPortlet.SAVE); private Button bSave = new Button(ConstantsPortlet.SAVE);
// private Label labelSearchIn = new Label();
private TextField<String> textFull = new TextField<String>(); private TextField<String> textFull = new TextField<String>();
private DateField fromDate = new DateField(); private DateField fromDate = new DateField();
private DateField toDate = new DateField(); private DateField toDate = new DateField();
private SimpleComboBox<String> cbNameFilter = null; private SimpleComboBox<String> cbNameFilter = null;
// private HorizontalPanel hpToolbarPathPanel = null;
private boolean isSearchActive = false; private boolean isSearchActive = false;
private VerticalPanel verticalPanel = new VerticalPanel(); private VerticalPanel verticalPanel = new VerticalPanel();
private HorizontalPanel hp = new HorizontalPanel(); private HorizontalPanel hp = new HorizontalPanel();
// private HorizontalPanel hp2 = new HorizontalPanel();
private HorizontalPanel hpMain = new HorizontalPanel(); private HorizontalPanel hpMain = new HorizontalPanel();
private GxtBreadcrumbPathPanel toolbarPahtPanel; private GxtBreadcrumbPathPanel toolbarPahtPanel;
/**
* Instantiates a new gxt seach and filter panel.
*
* @param toolBarPathPanel the tool bar path panel
*/
public GxtSeachAndFilterPanel(GxtBreadcrumbPathPanel toolBarPathPanel) { public GxtSeachAndFilterPanel(GxtBreadcrumbPathPanel toolBarPathPanel) {
setLayout(new FitLayout()); setLayout(new FitLayout());
setBorders(true); setBorders(true);
this.setId("SearchAndFilter"); this.setId("SearchAndFilter");
this.setBorders(false); this.setBorders(false);
// this.setStyleAttribute("background-color", "#d0def0");
this.comboBoxGxt = new GxtComboBox(); this.comboBoxGxt = new GxtComboBox();
this.cbViewScope = this.comboBoxGxt.getComboViewScope(); this.cbViewScope = this.comboBoxGxt.getComboViewScope();
this.cbNameFilter = this.comboBoxGxt.getComboStringFilter(); this.cbNameFilter = this.comboBoxGxt.getComboStringFilter();
this.textSearch.setId("text-search"); this.textSearch.setId("text-search");
// this.textSearch.setStyleAttribute("margin-bottom", "0px");
this.cbViewScope.setWidth(360); this.cbViewScope.setWidth(360);
// this.cbViewScope.setAutoWidth(true);
this.toolbarPahtPanel = toolBarPathPanel; this.toolbarPahtPanel = toolBarPathPanel;
hp.setStyleAttribute("margin-left", "2px"); hp.setStyleAttribute("margin-left", "2px");
@ -86,8 +82,6 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
textSearch.setAllowBlank(true); textSearch.setAllowBlank(true);
textSearch.setEmptyText(ConstantsPortlet.SEARCHBYNAME); textSearch.setEmptyText(ConstantsPortlet.SEARCHBYNAME);
// textSearch.setWidth(325);
// textSearch.setHeight(12);
/* COMMENTED TO FIX https://support.social.isti.cnr.it/ticket/87 /* COMMENTED TO FIX https://support.social.isti.cnr.it/ticket/87
textSearch.setRegex("^[a-zA-Z0-9]+[ a-zA-Z0-9_().-]*"); //alphanumeric textSearch.setRegex("^[a-zA-Z0-9]+[ a-zA-Z0-9_().-]*"); //alphanumeric
@ -96,27 +90,23 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
*/ */
hp.add(textSearch); hp.add(textSearch);
bSearch.setStyleName("wizardButton"); // bSearch.setStyleName("wizardButton");
// bSearch.getElement().getStyle().setMarginLeft(3, Unit.PX); // bSearch.getElement().getStyle().setMarginLeft(3, Unit.PX);
bCancel.setStyleName("wizardButton"); // bCancel.setStyleName("wizardButton");
bCancel.getElement().getStyle().setMarginLeft(3, Unit.PX); bCancel.getElement().getStyle().setMarginLeft(3, Unit.PX);
bSave.setStyleName("wizardButton"); // bSave.setStyleName("wizardButton");
bSave.getElement().getStyle().setMarginLeft(3, Unit.PX); bSave.getElement().getStyle().setMarginLeft(3, Unit.PX);
hp.add(bSearch); hp.add(bSearch);
hp.add(bSave); hp.add(bSave);
hp.setVerticalAlign(VerticalAlignment.MIDDLE); hp.setVerticalAlign(VerticalAlignment.MIDDLE);
bSearch.addStyleName("button_toolbar");
// hp.setHeight(20); bSave.addStyleName("button_toolbar");
// hpMain.setHeight(20);
bSearch.setWidth("70px");
bSave.setWidth("70px");
cbViewScope.setStyleAttribute("margin-left", "132px"); cbViewScope.setStyleAttribute("margin-left", "132px");
cbViewScope.setStyleAttribute("margin-top", "2px"); cbViewScope.setStyleAttribute("margin-top", "2px");
hpMain.setId("hpMain"); hpMain.setId("hpSearchAndFilter");
hpMain.setStyleAttribute("background", "#D0DEF0"); // hpMain.setStyleAttribute("background", "#D0DEF0");
verticalPanel.setId("VerticalPanelSearchAndFilter"); verticalPanel.setId("VerticalPanelSearchAndFilter");
verticalPanel.setStyleAttribute("background", "#D0DEF0"); verticalPanel.setStyleAttribute("background", "#D0DEF0");
hpMain.add(hp); hpMain.add(hp);
@ -124,7 +114,6 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
//SOLUTION FOR SCOPE INVISIBLE //SOLUTION FOR SCOPE INVISIBLE
cbViewScope.setVisible(false); cbViewScope.setVisible(false);
verticalPanel.add(this.toolbarPahtPanel.getToolBarPathPanel()); verticalPanel.add(this.toolbarPahtPanel.getToolBarPathPanel());
verticalPanel.add(hpMain); verticalPanel.add(hpMain);
verticalPanel.setVerticalAlign(VerticalAlignment.MIDDLE); verticalPanel.setVerticalAlign(VerticalAlignment.MIDDLE);
@ -143,27 +132,9 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
layout(); layout();
} }
/*
private void initSearchIn(){
hpSearchIn.removeAll();
searchInFolderId = "";
labelSearchIn.setText("");
// labelSearchIn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
hpSearchIn.add(labelSearchIn);
hpSearchIn.setStyleAttribute("margin-left", "3px");
hpSearchIn.add(bSearchIn);
hpSearchIn.layout(true);
}
private void selectedFolderToSearch(Item item){
searchInFolderId = item.getId();
labelSearchIn.setText("in "+item.getName());
labelSearchIn.setTitle("search in "+item.getName());
}*/
/** /**
* Update window size * Update window size.
*/ */
public void updateSize() { public void updateSize() {
RootPanel workspace = RootPanel.get(ConstantsPortlet.WORKSPACEDIV); RootPanel workspace = RootPanel.get(ConstantsPortlet.WORKSPACEDIV);
@ -177,6 +148,11 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
// hp.setWidth(rootWidth - 500); // hp.setWidth(rootWidth - 500);
} }
/**
* Search text.
*
* @param value the value
*/
public void searchText(String value){ public void searchText(String value){
textSearch.setValue(value); textSearch.setValue(value);
seVisibleButtonsCancelSave(true); seVisibleButtonsCancelSave(true);
@ -184,6 +160,9 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
AppController.getEventBus().fireEvent(new SearchTextEvent(value, parentId)); AppController.getEventBus().fireEvent(new SearchTextEvent(value, parentId));
} }
/**
* Adds the listeners.
*/
private void addListeners(){ private void addListeners(){
bSearch.addClickHandler(new ClickHandler() { bSearch.addClickHandler(new ClickHandler() {
@ -213,15 +192,6 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
textSearch.addKeyListener(keyListener); textSearch.addKeyListener(keyListener);
// //
// bCancel.addClickHandler(new ClickHandler() {
// @Override
// public void onClick(ClickEvent event) {
// if(textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid()){
// searchCancel();
// AppController.getEventBus().fireEvent(new SearchTextEvent(null));
// }
// }
// });
bSave.addClickHandler(new ClickHandler() { bSave.addClickHandler(new ClickHandler() {
@Override @Override
@ -249,6 +219,9 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
} }
/**
* Reset fields.
*/
public void resetFields(){ public void resetFields(){
this.textSearch.reset(); this.textSearch.reset();
this.textFull.reset(); this.textFull.reset();
@ -258,48 +231,95 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
} }
/**
* Checks if is valid search.
*
* @return true, if is valid search
*/
private boolean isValidSearch(){ private boolean isValidSearch(){
return textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid(); return textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid();
} }
/**
* Se visible buttons cancel save.
*
* @param flag the flag
*/
public void seVisibleButtonsCancelSave(boolean flag){ public void seVisibleButtonsCancelSave(boolean flag){
this.bCancel.setVisible(flag); this.bCancel.setVisible(flag);
this.bSave.setVisible(flag); this.bSave.setVisible(flag);
} }
/**
* Search cancel.
*/
public void searchCancel(){ public void searchCancel(){
resetFields(); resetFields();
// initSearchIn();
seVisibleButtonsCancelSave(false); seVisibleButtonsCancelSave(false);
} }
/**
* Checks if is search active.
*
* @return true, if is search active
*/
public boolean isSearchActive(){ public boolean isSearchActive(){
return this.isSearchActive; return this.isSearchActive;
} }
/**
* Sets the list scope.
*
* @param listScope the new list scope
*/
public void setListScope(List<ScopeModel> listScope){ public void setListScope(List<ScopeModel> listScope){
this.comboBoxGxt.setListScope(listScope); this.comboBoxGxt.setListScope(listScope);
} }
/**
* Select scope by index.
*
* @param index the index
*/
public void selectScopeByIndex(int index){ public void selectScopeByIndex(int index){
this.cbViewScope.setValue(cbViewScope.getStore().getAt(index)); this.cbViewScope.setValue(cbViewScope.getStore().getAt(index));
} }
/**
* Sets the search active.
*
* @param isSearchActive the new search active
*/
public void setSearchActive(boolean isSearchActive) { public void setSearchActive(boolean isSearchActive) {
this.isSearchActive = isSearchActive; this.isSearchActive = isSearchActive;
} }
/**
* Sets the visible button save.
*
* @param bool the new visible button save
*/
public void setVisibleButtonSave(boolean bool){ public void setVisibleButtonSave(boolean bool){
this.bSave.setVisible(bool); this.bSave.setVisible(bool);
} }
/**
* Sets the empty text.
*
* @param emptyText the new empty text
*/
public void setEmptyText(String emptyText){ public void setEmptyText(String emptyText){
textSearch.setEmptyText(emptyText); textSearch.setEmptyText(emptyText);
} }
/**
* Gets the toolbar path panel.
*
* @return the toolbar path panel
*/
public GxtBreadcrumbPathPanel getToolbarPathPanel() { public GxtBreadcrumbPathPanel getToolbarPathPanel() {
return toolbarPahtPanel; return toolbarPahtPanel;
} }

View File

@ -420,13 +420,27 @@
vertical-align: middle; vertical-align: middle;
} }
#hpSearchAndFilter {
background-color: #D0DEF0;
}
#hpSearchAndFilter td {
vertical-align: top;
!
important;
}
#text-search { #text-search {
margin-right: 3px; margin-right: 3px;
width: 325px !important; width: 325px !important;
} }
#text-search>input:first-child { #text-search-input {
height: 18px !important; height: 20px !important;
width: 319px !important; width: 312px !important;
padding: 1px 2px; /* padding: 1px 2px; */
}
.button_toolbar {
width: 60px;
} }