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:
parent
72333f84e0
commit
4fe7efd96e
|
@ -1,5 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
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
|
||||
warSrcDirIsOutput=false
|
||||
|
|
27
pom.xml
27
pom.xml
|
@ -51,21 +51,20 @@
|
|||
<version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- This dependency is needed and is need on TOP to use GWT UI BInder
|
||||
without old Xerces version of gCore complaining -->
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.9.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- This dependency is needed and is need on TOP to use GWT UI BInder without old Xerces version of gCore complaining -->
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>xerces</groupId> -->
|
||||
<!-- <artifactId>xercesImpl</artifactId> -->
|
||||
<!-- <version>2.9.1</version> -->
|
||||
<!-- <scope>provided</scope> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.googlecode.gwtquery</groupId>
|
||||
<artifactId>gwtquery</artifactId>
|
||||
<version>1.3.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>com.googlecode.gwtquery</groupId> -->
|
||||
<!-- <artifactId>gwtquery</artifactId> -->
|
||||
<!-- <version>1.3.3</version> -->
|
||||
<!-- <scope>provided</scope> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>org.gcube.core</groupId> -->
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
|||
public class SpeciesJobPanel extends ContentPanel{
|
||||
|
||||
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();
|
||||
|
@ -33,7 +33,7 @@ public class SpeciesJobPanel extends ContentPanel{
|
|||
private int jobOccurrenceCount = 0;
|
||||
private int jobTaxonomyCount = 0;
|
||||
|
||||
private TextField<String> lastQuery;
|
||||
private TextField<String> currentQuery;
|
||||
|
||||
public SpeciesJobPanel(EventBus eventBus) {
|
||||
this.setTopComponent(toolbar);
|
||||
|
@ -50,20 +50,20 @@ public class SpeciesJobPanel extends ContentPanel{
|
|||
createTaxonomyToolBar();
|
||||
|
||||
|
||||
Text txtLastQuery = new Text(LAST_QUERY);
|
||||
Text txtLastQuery = new Text(CURRENT_QUERY);
|
||||
txtLastQuery.setStyleAttribute("padding-right", "2px");
|
||||
txtLastQuery.setStyleAttribute("color", "gray");
|
||||
|
||||
lastQuery = new TextField<String>();
|
||||
currentQuery = new TextField<String>();
|
||||
|
||||
lastQuery.setReadOnly(true);
|
||||
lastQuery.setWidth(400);
|
||||
lastQuery.setValue(EMPTY);
|
||||
currentQuery.setReadOnly(true);
|
||||
currentQuery.setWidth(400);
|
||||
currentQuery.setValue(EMPTY);
|
||||
toolbar.add(new FillToolItem());
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -112,11 +112,11 @@ public class SpeciesJobPanel extends ContentPanel{
|
|||
}
|
||||
|
||||
public void setLastQuery(String query){
|
||||
this.lastQuery.setValue(query);
|
||||
this.currentQuery.setValue(query);
|
||||
}
|
||||
|
||||
public void setLastQueryAsEmpty(){
|
||||
this.lastQuery.setValue(EMPTY);
|
||||
this.currentQuery.setValue(EMPTY);
|
||||
}
|
||||
|
||||
private void resetOccurrenceCounter(){
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -101,10 +101,10 @@ public class SessionUtil {
|
|||
if (user == null) {
|
||||
|
||||
//for test only
|
||||
// user = "test.user";
|
||||
user = "test.user";
|
||||
// user = "lucio.lelii";
|
||||
// user = "pasquale.pagano";
|
||||
user = "francesco.mangiacrapa";
|
||||
// user = "francesco.mangiacrapa";
|
||||
|
||||
String scope = "/gcube/devsec"; //Development
|
||||
// String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityResearchEnvironment"; //Production
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<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. -->
|
||||
<entry-point
|
||||
|
|
Reference in New Issue