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 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.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();
hpPath.setLayout(new FitLayout());
hpPath.setBorders(true);
@ -148,21 +135,12 @@ public class GxtBasicTabPanel extends LayoutContainer {
@Override
public void selectionChanged(SelectionChangedEvent<ScopeModel> se) {
// Window.alert("selected scope" + se.getSelectedItem().get("name"));
//TODO
}
});
this.cbViewScope.setStyleAttribute("margin-left", "20px");
hpScope.add(this.cbViewScope);
// HorizontalPanel hpRadio = new HorizontalPanel();
// hpRadio.setLayout(new FitLayout());
// hpRadio.add(txtSwitch);
// hpRadio.add(radioGroup);
cp.add(hpPath,flex);
cp.add(hpScope,flex);
// cp.add(hpRadio, flex);
@ -182,17 +160,13 @@ public class GxtBasicTabPanel extends LayoutContainer {
cp.setBorders(false);
cp.setBodyBorder(false);
FormPanel formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setBodyBorder(false);
// formPanel.setFrame(true);
formPanel.setWidth(350);
FormData formData = new FormData("-20");
cbNameFilter.setFieldLabel("Name Filter");
// combo.setDisplayField("name");
formPanel.add(cbNameFilter, formData);
@ -238,7 +212,6 @@ public class GxtBasicTabPanel extends LayoutContainer {
@Override
public void componentSelected(ButtonEvent ce) {
resetFieldsInTabSearch();
}
});
@ -279,7 +252,7 @@ public class GxtBasicTabPanel extends LayoutContainer {
public void setLabelPath(String path){
if(path != null && (!path.isEmpty()))
if(path != null && !path.isEmpty())
this.labelPath.setText(path);
else
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.TextField;
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.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* @author Massimiliano Assante ISTI-CNR
* The Class GxtSeachAndFilterPanel.
*
* @version 1.0 May 14th 2012
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 1, 2016
*/
public class GxtSeachAndFilterPanel extends LayoutContainer {
@ -45,40 +46,35 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
private ComboBox<ScopeModel> cbViewScope = null;
private final TextField<String> textSearch = new TextField<String>();
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 bSave = new Button(ConstantsPortlet.SAVE);
// private Label labelSearchIn = new Label();
private TextField<String> textFull = new TextField<String>();
private DateField fromDate = new DateField();
private DateField toDate = new DateField();
private SimpleComboBox<String> cbNameFilter = null;
// private HorizontalPanel hpToolbarPathPanel = null;
private boolean isSearchActive = false;
private VerticalPanel verticalPanel = new VerticalPanel();
private HorizontalPanel hp = new HorizontalPanel();
// private HorizontalPanel hp2 = new HorizontalPanel();
private HorizontalPanel hpMain = new HorizontalPanel();
private GxtBreadcrumbPathPanel toolbarPahtPanel;
/**
* Instantiates a new gxt seach and filter panel.
*
* @param toolBarPathPanel the tool bar path panel
*/
public GxtSeachAndFilterPanel(GxtBreadcrumbPathPanel toolBarPathPanel) {
setLayout(new FitLayout());
setBorders(true);
this.setId("SearchAndFilter");
this.setBorders(false);
// this.setStyleAttribute("background-color", "#d0def0");
this.comboBoxGxt = new GxtComboBox();
this.cbViewScope = this.comboBoxGxt.getComboViewScope();
this.cbNameFilter = this.comboBoxGxt.getComboStringFilter();
this.textSearch.setId("text-search");
// this.textSearch.setStyleAttribute("margin-bottom", "0px");
this.cbViewScope.setWidth(360);
// this.cbViewScope.setAutoWidth(true);
this.toolbarPahtPanel = toolBarPathPanel;
hp.setStyleAttribute("margin-left", "2px");
@ -86,8 +82,6 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
textSearch.setAllowBlank(true);
textSearch.setEmptyText(ConstantsPortlet.SEARCHBYNAME);
// textSearch.setWidth(325);
// textSearch.setHeight(12);
/* COMMENTED TO FIX https://support.social.isti.cnr.it/ticket/87
textSearch.setRegex("^[a-zA-Z0-9]+[ a-zA-Z0-9_().-]*"); //alphanumeric
@ -96,27 +90,23 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
*/
hp.add(textSearch);
bSearch.setStyleName("wizardButton");
// bSearch.setStyleName("wizardButton");
// bSearch.getElement().getStyle().setMarginLeft(3, Unit.PX);
bCancel.setStyleName("wizardButton");
// bCancel.setStyleName("wizardButton");
bCancel.getElement().getStyle().setMarginLeft(3, Unit.PX);
bSave.setStyleName("wizardButton");
// bSave.setStyleName("wizardButton");
bSave.getElement().getStyle().setMarginLeft(3, Unit.PX);
hp.add(bSearch);
hp.add(bSave);
hp.setVerticalAlign(VerticalAlignment.MIDDLE);
// hp.setHeight(20);
// hpMain.setHeight(20);
bSearch.setWidth("70px");
bSave.setWidth("70px");
bSearch.addStyleName("button_toolbar");
bSave.addStyleName("button_toolbar");
cbViewScope.setStyleAttribute("margin-left", "132px");
cbViewScope.setStyleAttribute("margin-top", "2px");
hpMain.setId("hpMain");
hpMain.setStyleAttribute("background", "#D0DEF0");
hpMain.setId("hpSearchAndFilter");
// hpMain.setStyleAttribute("background", "#D0DEF0");
verticalPanel.setId("VerticalPanelSearchAndFilter");
verticalPanel.setStyleAttribute("background", "#D0DEF0");
hpMain.add(hp);
@ -124,7 +114,6 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
//SOLUTION FOR SCOPE INVISIBLE
cbViewScope.setVisible(false);
verticalPanel.add(this.toolbarPahtPanel.getToolBarPathPanel());
verticalPanel.add(hpMain);
verticalPanel.setVerticalAlign(VerticalAlignment.MIDDLE);
@ -143,27 +132,9 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
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() {
RootPanel workspace = RootPanel.get(ConstantsPortlet.WORKSPACEDIV);
@ -177,6 +148,11 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
// hp.setWidth(rootWidth - 500);
}
/**
* Search text.
*
* @param value the value
*/
public void searchText(String value){
textSearch.setValue(value);
seVisibleButtonsCancelSave(true);
@ -184,6 +160,9 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
AppController.getEventBus().fireEvent(new SearchTextEvent(value, parentId));
}
/**
* Adds the listeners.
*/
private void addListeners(){
bSearch.addClickHandler(new ClickHandler() {
@ -213,15 +192,6 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
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() {
@Override
@ -249,6 +219,9 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
}
/**
* Reset fields.
*/
public void resetFields(){
this.textSearch.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(){
return textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid();
}
/**
* Se visible buttons cancel save.
*
* @param flag the flag
*/
public void seVisibleButtonsCancelSave(boolean flag){
this.bCancel.setVisible(flag);
this.bSave.setVisible(flag);
}
/**
* Search cancel.
*/
public void searchCancel(){
resetFields();
// initSearchIn();
seVisibleButtonsCancelSave(false);
}
/**
* Checks if is search active.
*
* @return true, if is search active
*/
public boolean isSearchActive(){
return this.isSearchActive;
}
/**
* Sets the list scope.
*
* @param listScope the new list scope
*/
public void setListScope(List<ScopeModel> listScope){
this.comboBoxGxt.setListScope(listScope);
}
/**
* Select scope by index.
*
* @param index the index
*/
public void selectScopeByIndex(int index){
this.cbViewScope.setValue(cbViewScope.getStore().getAt(index));
}
/**
* Sets the search active.
*
* @param isSearchActive the new search active
*/
public void setSearchActive(boolean isSearchActive) {
this.isSearchActive = isSearchActive;
}
/**
* Sets the visible button save.
*
* @param bool the new visible button save
*/
public void setVisibleButtonSave(boolean bool){
this.bSave.setVisible(bool);
}
/**
* Sets the empty text.
*
* @param emptyText the new empty text
*/
public void setEmptyText(String emptyText){
textSearch.setEmptyText(emptyText);
}
/**
* Gets the toolbar path panel.
*
* @return the toolbar path panel
*/
public GxtBreadcrumbPathPanel getToolbarPathPanel() {
return toolbarPahtPanel;
}

View File

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