removed switch button

renamed "Last Query" as "Current Query"

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/speciesdiscovery@81406 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-09-13 12:12:39 +00:00
parent 72333f84e0
commit 4fe7efd96e
7 changed files with 28 additions and 174 deletions

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
jarsExcludedFromWebInfLib= jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francesco-mangiacrapa/wseclipse/speciesdiscovery(trunk)/target/species-discovery-3.3.0-SNAPSHOT lastWarOutDir=/home/francesco-mangiacrapa/wseclipse/speciesdiscovery/target/species-discovery-3.3.0-SNAPSHOT
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

27
pom.xml
View File

@ -51,21 +51,20 @@
<version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version> <version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- This dependency is needed and is need on TOP to use GWT UI BInder <!-- This dependency is needed and is need on TOP to use GWT UI BInder without old Xerces version of gCore complaining -->
without old Xerces version of gCore complaining --> <!-- <dependency> -->
<dependency> <!-- <groupId>xerces</groupId> -->
<groupId>xerces</groupId> <!-- <artifactId>xercesImpl</artifactId> -->
<artifactId>xercesImpl</artifactId> <!-- <version>2.9.1</version> -->
<version>2.9.1</version> <!-- <scope>provided</scope> -->
<scope>provided</scope> <!-- </dependency> -->
</dependency>
<dependency> <!-- <dependency> -->
<groupId>com.googlecode.gwtquery</groupId> <!-- <groupId>com.googlecode.gwtquery</groupId> -->
<artifactId>gwtquery</artifactId> <!-- <artifactId>gwtquery</artifactId> -->
<version>1.3.3</version> <!-- <version>1.3.3</version> -->
<scope>provided</scope> <!-- <scope>provided</scope> -->
</dependency> <!-- </dependency> -->
<!-- <dependency> --> <!-- <dependency> -->
<!-- <groupId>org.gcube.core</groupId> --> <!-- <groupId>org.gcube.core</groupId> -->

View File

@ -22,7 +22,7 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
public class SpeciesJobPanel extends ContentPanel{ public class SpeciesJobPanel extends ContentPanel{
protected static final String EMPTY = "Empty"; protected static final String EMPTY = "Empty";
protected static final String LAST_QUERY = "Last query: "; protected static final String CURRENT_QUERY = "Current query: ";
private ToolBar toolbar = new ToolBar(); private ToolBar toolbar = new ToolBar();
@ -33,7 +33,7 @@ public class SpeciesJobPanel extends ContentPanel{
private int jobOccurrenceCount = 0; private int jobOccurrenceCount = 0;
private int jobTaxonomyCount = 0; private int jobTaxonomyCount = 0;
private TextField<String> lastQuery; private TextField<String> currentQuery;
public SpeciesJobPanel(EventBus eventBus) { public SpeciesJobPanel(EventBus eventBus) {
this.setTopComponent(toolbar); this.setTopComponent(toolbar);
@ -50,20 +50,20 @@ public class SpeciesJobPanel extends ContentPanel{
createTaxonomyToolBar(); createTaxonomyToolBar();
Text txtLastQuery = new Text(LAST_QUERY); Text txtLastQuery = new Text(CURRENT_QUERY);
txtLastQuery.setStyleAttribute("padding-right", "2px"); txtLastQuery.setStyleAttribute("padding-right", "2px");
txtLastQuery.setStyleAttribute("color", "gray"); txtLastQuery.setStyleAttribute("color", "gray");
lastQuery = new TextField<String>(); currentQuery = new TextField<String>();
lastQuery.setReadOnly(true); currentQuery.setReadOnly(true);
lastQuery.setWidth(400); currentQuery.setWidth(400);
lastQuery.setValue(EMPTY); currentQuery.setValue(EMPTY);
toolbar.add(new FillToolItem()); toolbar.add(new FillToolItem());
toolbar.add(txtLastQuery); toolbar.add(txtLastQuery);
toolbar.add(lastQuery); toolbar.add(currentQuery);
RenderTextFieldUtil.setTextFieldAttr(lastQuery, "background", "none"); RenderTextFieldUtil.setTextFieldAttr(currentQuery, "background", "none");
// RenderTextFieldUtil.setTextFieldAttr(lastQuery, "text-align", "right"); // RenderTextFieldUtil.setTextFieldAttr(lastQuery, "text-align", "right");
} }
@ -112,11 +112,11 @@ public class SpeciesJobPanel extends ContentPanel{
} }
public void setLastQuery(String query){ public void setLastQuery(String query){
this.lastQuery.setValue(query); this.currentQuery.setValue(query);
} }
public void setLastQueryAsEmpty(){ public void setLastQueryAsEmpty(){
this.lastQuery.setValue(EMPTY); this.currentQuery.setValue(EMPTY);
} }
private void resetOccurrenceCounter(){ private void resetOccurrenceCounter(){

View File

@ -1,132 +0,0 @@
package org.gcube.portlets.user.speciesdiscovery.client.switchbutton;
import static com.google.gwt.query.client.GQuery.$;
import org.gcube.portlets.user.gcubewidgets.client.elements.Div;
import org.gcube.portlets.user.gcubewidgets.client.elements.Span;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.query.client.css.CSS;
import com.google.gwt.query.client.css.Length;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.HasName;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.Widget;
public class SwitchButton extends Composite implements HasName, HasValue<Boolean>{
private static SwitchButtonUiBinder uiBinder = GWT
.create(SwitchButtonUiBinder.class);
interface SwitchButtonUiBinder extends UiBinder<Widget, SwitchButton> {
}
@UiField FocusPanel switchContainer;
@UiField Div switcherButton;
@UiField Span labelOff;
@UiField Span labelOn;
private String name;
private Boolean value;
private Boolean valueChangeHandlerInitialized = Boolean.FALSE;
public SwitchButton() {
name = DOM.createUniqueId();
initWidget(uiBinder.createAndBindUi(this));
value = false;
$(switcherButton).css(CSS.LEFT.with(Length.px(-1)));
ensureDomEventHandlers();
}
public SwitchButton(boolean initialValue) {
this();
setValue(initialValue);
}
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Boolean> handler) {
// Is this the first value change handler? If so, time to add handlers
if (!valueChangeHandlerInitialized) {
valueChangeHandlerInitialized = true;
}
return addHandler(handler, ValueChangeEvent.getType());
}
@Override
public Boolean getValue() {
return value;
}
/**
* Checks or unchecks the switch button box, firing {@link ValueChangeEvent} if
* appropriate.
* <p>
* Note that this <em>does not</em> set the value property of the checkbox
* input element wrapped by this widget. For access to that property, see
* {@link #setFormValue(String)}
*
* @param value true to set on, false to set off; null value implies false
*/
@Override
public void setValue(Boolean value) {
if (value == null) {
value = Boolean.FALSE;
}
Boolean oldValue = getValue();
if (value.equals(oldValue)) {
return;
}
this.value = value;
if (!value) {
$(switcherButton).animate("left: -1", 250);
labelOff.setStyleName("switch-button-label on");
labelOn.setStyleName("switch-button-label off");
} else {
$(switcherButton).animate("left: 12", 250);
labelOff.setStyleName("switch-button-label off");
labelOn.setStyleName("switch-button-label on");
}
}
/**
* Checks or unchecks the switch button box, firing {@link ValueChangeEvent} if
* appropriate.
* <p>
*
* @param value true to set on, false to set off; null value implies false
* @param fireEvents If true, and value has changed, fire a
* {@link ValueChangeEvent}
*/
@Override
public void setValue(Boolean value, boolean fireEvents) {
setValue(value);
if (fireEvents) {
ValueChangeEvent.fire(this, value);
}
}
protected void ensureDomEventHandlers() {
switchContainer.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
setValue(!value);
ValueChangeEvent.fire(SwitchButton.this, getValue());
}
});
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
}

View File

@ -1,13 +0,0 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:e="urn:import:org.gcube.portlets.user.gcubewidgets.client.elements"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<g:HTMLPanel>
<e:Span styleName="switch-button-label on" ui:field="labelOff">OFF</e:Span>
<g:FocusPanel ui:field="switchContainer" styleName="switch-button-background">
<e:Div ui:field="switcherButton" styleName="switch-button-button"></e:Div>
</g:FocusPanel>
<e:Span styleName="switch-button-label off" ui:field="labelOn">ON</e:Span>
<div style="clear: left;"></div>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -101,10 +101,10 @@ public class SessionUtil {
if (user == null) { if (user == null) {
//for test only //for test only
// user = "test.user"; user = "test.user";
// user = "lucio.lelii"; // user = "lucio.lelii";
// user = "pasquale.pagano"; // user = "pasquale.pagano";
user = "francesco.mangiacrapa"; // user = "francesco.mangiacrapa";
String scope = "/gcube/devsec"; //Development String scope = "/gcube/devsec"; //Development
// String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityResearchEnvironment"; //Production // String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityResearchEnvironment"; //Production

View File

@ -11,7 +11,7 @@
<set-property name="log_DivLogger" value="DISABLED" /> <set-property name="log_DivLogger" value="DISABLED" />
<inherits name='com.google.gwt.query.Query' /> <!-- <inherits name='com.google.gwt.query.Query' /> -->
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<entry-point <entry-point