Last active
January 26, 2020 05:05
-
-
Save branflake2267/1c4fca8998a8d6e71d388237f3d1b6c0 to your computer and use it in GitHub Desktop.
GXT 4 with TextButtonCell. The TextButton cell can be disabled, disabling clicks and with disabled style.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gwt.core.client.GWT; | |
import com.google.gwt.resources.client.ClientBundle; | |
import com.google.gwt.resources.client.CssResource; | |
public interface CompositeCellResources extends ClientBundle { | |
public CompositeCellResources INSTANCE = GWT.create(CompositeCellResources.class); | |
public interface GridStyles extends CssResource { | |
String button(); | |
} | |
@Source("GridStyles.gss") | |
public GridStyles styles(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.button td > div { | |
line-height: 10px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class Stock { | |
private Integer id; | |
private Double change; | |
private Date date = new Date(); | |
private String industry = getType(); | |
private Double last; | |
private String name; | |
private Double open; | |
private String symbol; | |
private boolean split = Boolean.valueOf(Math.random() > .5); | |
private static int COUNTER = 0; | |
private String filter; | |
public Stock() { | |
this.id = Integer.valueOf(COUNTER++); | |
} | |
public Stock(String name, double open, double change, double pctChange, Date date, String industry) { | |
this(); | |
this.change = change; | |
this.date = date; | |
this.industry = industry; | |
this.name = name; | |
this.open = open; | |
} | |
public Stock(String name, String symbol, double open, double last, Date date) { | |
this(); | |
this.date = date; | |
this.symbol = symbol; | |
this.name = name; | |
this.open = open; | |
this.last = last; | |
this.change = last - open; | |
} | |
public Integer getId() { | |
return id; | |
} | |
public void setId(Integer id) { | |
this.id = id; | |
} | |
public Double getChange() { | |
return change; | |
} | |
public void setChange(Double change) { | |
this.change = change; | |
} | |
public Date getDate() { | |
return date; | |
} | |
public void setDate(Date date) { | |
this.date = date; | |
} | |
public String getIndustry() { | |
return industry; | |
} | |
public void setIndustry(String industry) { | |
this.industry = industry; | |
} | |
public Double getLast() { | |
return last; | |
} | |
public void setLast(Double last) { | |
this.last = last; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public Double getOpen() { | |
return open; | |
} | |
public void setOpen(Double open) { | |
this.open = open; | |
} | |
public String getSymbol() { | |
return symbol; | |
} | |
public void setSymbol(String symbol) { | |
this.symbol = symbol; | |
} | |
public boolean isSplit() { | |
return split; | |
} | |
public void setSplit(boolean split) { | |
this.split = split; | |
} | |
public double getPercentageChange() { | |
return getChange() / getOpen(); | |
} | |
private String getType() { | |
double r = Math.random(); | |
if (r <= .25) { | |
return "Auto"; | |
} else if (r <= .5) { | |
return "Media"; | |
} else if (r <= .75) { | |
return "Medica;"; | |
} | |
return "Tech"; | |
} | |
@Override | |
public String toString() { | |
String s = ""; | |
s += "name=" + name + " "; | |
s += "name=" + name + " "; | |
return s; | |
} | |
public String getFilter() { | |
return filter; | |
} | |
public void setFilter(String filter) { | |
this.filter = filter; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first button cell is disabled.