diff options
author | Dirk Fauth | 2015-07-23 19:49:27 +0000 |
---|---|---|
committer | Dirk Fauth | 2015-07-24 08:30:31 +0000 |
commit | e9cd22ceca4071b743db6b7d218832a9bf681742 (patch) | |
tree | 017f41aec26969b3ff7e5141e25d8a489d3638ea | |
parent | 9eb50bd9645ed28f0aaf1ce3e64be443293a50ad (diff) | |
download | org.eclipse.nebula.widgets.nattable-e9cd22ceca4071b743db6b7d218832a9bf681742.tar.gz org.eclipse.nebula.widgets.nattable-e9cd22ceca4071b743db6b7d218832a9bf681742.tar.xz org.eclipse.nebula.widgets.nattable-e9cd22ceca4071b743db6b7d218832a9bf681742.zip |
Bug 473412 - [Build] remove NatTable builder from automated build
Change-Id: I210d8f50af5dcfc88e30d35e2cd0832bc7b8cb22
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
4 files changed, 5 insertions, 477 deletions
diff --git a/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF index a93a53f6..3c99f46b 100644 --- a/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF @@ -26,7 +26,6 @@ Import-Package: ca.odell.glazedlists, org.eclipse.swt.widgets Require-Bundle: org.eclipse.nebula.widgets.nattable.core, org.eclipse.nebula.widgets.nattable.extension.glazedlists, - org.eclipse.nebula.widgets.nattable.extension.builder, org.eclipse.nebula.widgets.nattable.dataset, org.eclipse.nebula.widgets.nattable.extension.poi Bundle-Vendor: Eclipse Nebula NatTable diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/NatTableBuilderExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/NatTableBuilderExample.java deleted file mode 100644 index c0cfed92..00000000 --- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/NatTableBuilderExample.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Original authors and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Original authors and others - initial API and implementation - ******************************************************************************/ -package org.eclipse.nebula.widgets.nattable.examples.examples._102_Configuration; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; - -import org.eclipse.nebula.widgets.nattable.NatTable; -import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes; -import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; -import org.eclipse.nebula.widgets.nattable.data.ListDataProvider; -import org.eclipse.nebula.widgets.nattable.data.convert.DefaultDoubleDisplayConverter; -import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider; -import org.eclipse.nebula.widgets.nattable.examples.AbstractNatExample; -import org.eclipse.nebula.widgets.nattable.examples.fixtures.TableRowFixture; -import org.eclipse.nebula.widgets.nattable.examples.runner.StandaloneNatExampleRunner; -import org.eclipse.nebula.widgets.nattable.extension.builder.NatTableBuilder; -import org.eclipse.nebula.widgets.nattable.extension.builder.model.ColumnStyle; -import org.eclipse.nebula.widgets.nattable.extension.builder.model.Editors; -import org.eclipse.nebula.widgets.nattable.extension.builder.model.TableColumn; -import org.eclipse.nebula.widgets.nattable.extension.builder.model.TableModel; -import org.eclipse.nebula.widgets.nattable.extension.builder.util.DisplayConverters; -import org.eclipse.nebula.widgets.nattable.layer.cell.CellOverrideLabelAccumulator; -import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes; -import org.eclipse.nebula.widgets.nattable.style.DisplayMode; -import org.eclipse.nebula.widgets.nattable.style.Style; -import org.eclipse.nebula.widgets.nattable.test.fixture.data.RowDataListFixture; -import org.eclipse.nebula.widgets.nattable.util.GUIHelper; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -import ca.odell.glazedlists.GlazedLists; - -public class NatTableBuilderExample extends AbstractNatExample { - - private NatTableBuilder<TableRowFixture> builder; - private NatTable natTable; - - public static void main(String[] args) throws Exception { - StandaloneNatExampleRunner.run(800, 600, new NatTableBuilderExample()); - } - - @Override - public Control createExampleControl(Composite parent) { - TableColumn[] columns = new TableColumn[] { - new TableColumn(0, "securityId", "ISIN").setWidth(200) - .setEditor(Editors.getTextEditor()).setCategory("C1"), - new TableColumn(1, "securityDescription", "Name") - .setStyle(new ColumnStyle()).setGroupName("A1") - .setCategory("C1"), - new TableColumn(2, "rating", "Rating") - .setComparator(getIgnoreCaseComparator()) - .setGroupName("A1").setCategory("C1"), - new TableColumn(3, "issueDate", "issueDate").setCategory("C1"), - new TableColumn(4, "pricingType", "Pricing type") - .setEditor( - Editors.getComboboxEditor(getPricingComboDataProvider())) - .setFilterRowEditor( - Editors.getComboboxEditor(getPricingComboDataProvider())) - .setCategory("C1"), - - new TableColumn(5, "bidPrice", "Bid price") - .setEditor(Editors.getTextEditor()) - .setDisplayConverter( - new DefaultDoubleDisplayConverter()) - .setGroupName("Pricing").setCategory("C1"), - - new TableColumn(6, "askPrice", "Ask price") - .setGroupName("Pricing") - .setDisplayConverter( - DisplayConverters - .getDoubleDisplayConverter("##.00")) - .setCategory("C1"), - - new TableColumn(7, "lotSize", "Lot size").setCategory("C1"), - new TableColumn(8, "publishFlag", "Published").setEditor( - Editors.getCheckBoxEditor()).setCategory("C1"), - new TableColumn(9, "high52Week", "52 Week high") - .setCategory("C3"), - new TableColumn(10, "low52Week", "52 week low") - .setCategory("C3"), - new TableColumn(11, "eps", "EPS").setCategory("C2"), - new TableColumn(12, "volume", "Volume").setCategory("C2"), - new TableColumn(13, "marketCap", "Market cap.") - .setCategory("C2"), - new TableColumn(14, "institutionOwned", "Institution owned") - .setCategory("C2"), }; - TableModel table = new TableModel(columns); - - this.builder = new NatTableBuilder<TableRowFixture>(parent, table, - GlazedLists.eventList(TableRowFixture.getList()), - TableRowFixture.rowIdAccessor); - - // Setup all the layer stacks - this.natTable = this.builder.setupLayerStacks(); - - // Since the build() method has not been invoked yet you can - // tweak layer configuration as you want - customize(); - - return this.builder.build(); - } - - private void customize() { - Style style = new Style(); - style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, - GUIHelper.COLOR_RED); - - ListDataProvider<TableRowFixture> bodyDataProvider = this.builder - .getBodyLayerStack().getDataProvider(); - CellOverrideLabelAccumulator<TableRowFixture> myAccumulator = new CellOverrideLabelAccumulator<TableRowFixture>( - bodyDataProvider); - myAccumulator.registerOverride("AAA", 2, "myLabel"); - - this.builder.addCellLabelsToBody(myAccumulator); - - IConfigRegistry configRegistry = this.natTable.getConfigRegistry(); - configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, - style, DisplayMode.NORMAL, "myLabel"); - } - - private IComboBoxDataProvider getPricingComboDataProvider() { - return new IComboBoxDataProvider() { - @Override - public List<?> getValues(int columnIndex, int rowIndex) { - return Arrays.asList(RowDataListFixture.PRICING_AUTO, - RowDataListFixture.PRICING_MANUAL); - } - }; - } - - private Comparator<?> getIgnoreCaseComparator() { - return new Comparator<String>() { - @Override - public int compare(String o1, String o2) { - return o1.compareToIgnoreCase(o2); - } - }; - }; -} diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/fixtures/TableRowFixture.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/fixtures/TableRowFixture.java deleted file mode 100644 index 6fee7a21..00000000 --- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/fixtures/TableRowFixture.java +++ /dev/null @@ -1,321 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Original authors and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Original authors and others - initial API and implementation - ******************************************************************************/ -package org.eclipse.nebula.widgets.nattable.examples.fixtures; - -import static org.eclipse.nebula.widgets.nattable.test.fixture.data.RowDataListFixture.PRICING_AUTO; -import static org.eclipse.nebula.widgets.nattable.test.fixture.data.RowDataListFixture.PRICING_MANUAL; -import static org.eclipse.nebula.widgets.nattable.util.ObjectUtils.getRandomDate; -import static org.eclipse.nebula.widgets.nattable.util.ObjectUtils.getRandomNumber; - -import java.io.Serializable; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; - -import org.eclipse.nebula.widgets.nattable.data.IRowIdAccessor; -import org.eclipse.nebula.widgets.nattable.extension.builder.model.TableRow; -import org.eclipse.nebula.widgets.nattable.test.fixture.data.PricingTypeBean; -import org.eclipse.nebula.widgets.nattable.util.ObjectUtils; - -public class TableRowFixture implements TableRow { - - public String securityId; - public String securityDescription; - public String rating; - public Date issueDate; - public PricingTypeBean pricingType; - public Double bidPrice; - public Double askPrice; - public int lotSize; - public Boolean publishFlag; - - public Double high52Week; - public Double low52Week; - public Double eps; - public Double volume; - public Double marketCap; - public Double institutionOwned; - - public final String[] propertyNames = { "securityId", - "securityDescription", "rating", "issueDate", "pricingType", - "bidPrice", "askPrice", "lotSize", "publishFlag", "high52Week", - "low52Week", "eps", "volume", "marketCap", "institutionOwned" }; - - public static final IRowIdAccessor<TableRowFixture> rowIdAccessor = new IRowIdAccessor<TableRowFixture>() { - @Override - public Serializable getRowId(TableRowFixture rowObject) { - return rowObject.getSecurityId(); - } - }; - - public TableRowFixture(String security_id, String security_description, - String rating, Date issue_date, PricingTypeBean pricing_type, - double bid_price, double ask_price, int lot_size, - boolean publish_flag, double high52Week, double low52Week, - double eps, double volume, double marketCap, double institutionOwned) { - super(); - this.securityId = security_id; - this.securityDescription = security_description; - this.rating = rating; - this.issueDate = issue_date; - this.pricingType = pricing_type; - this.bidPrice = bid_price; - this.askPrice = ask_price; - this.lotSize = lot_size; - this.publishFlag = publish_flag; - this.high52Week = high52Week; - this.low52Week = low52Week; - this.eps = eps; - this.volume = volume; - this.marketCap = marketCap; - this.institutionOwned = institutionOwned; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - TableRowFixture other = (TableRowFixture) obj; - if (this.securityId == null) { - if (other.securityId != null) - return false; - } else if (!this.securityId.equals(other.securityId)) - return false; - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((this.securityId == null) ? 0 : this.securityId.hashCode()); - return result; - } - - /** - * Convenience method to quickly get a new instance - */ - public static TableRowFixture getInstance(String descrition, String rating) { - return new TableRowFixture("US" + ObjectUtils.getRandomNumber(1000), - descrition, rating, getRandomDate(), PRICING_MANUAL, 1.000, 10, - 1000, true, 1.00, 1.01, -.01, 1000, 1000, 1000D); - } - - @Override - public String toString() { - return "TableRowFixture [securityId=" + this.securityId + ", securityDescription=" + this.securityDescription + ", rating=" + this.rating - + ", issueDate=" + this.issueDate - + ", pricingType=" + this.pricingType + ", bidPrice=" + this.bidPrice + ", askPrice=" + this.askPrice + ", lotSize=" + this.lotSize - + ", publishFlag=" - + this.publishFlag + ", high52Week=" + this.high52Week + ", low52Week=" + this.low52Week + ", eps=" + this.eps + ", volume=" + this.volume - + ", marketCap=" + this.marketCap - + ", institutionOwned=" + this.institutionOwned + ", propertyNames=" + Arrays.toString(this.propertyNames) + "]"; - } - - @Override - public Object getData() { - return this; - } - - @Override - public Object getIdentifier() { - return this.securityId; - } - - @Override - public Object getValue(int columnIndex) { - return getValue(this.propertyNames[columnIndex]); - } - - @Override - public void setValue(int columnIndex, Object value) { - setValue(this.propertyNames[columnIndex], value); - } - - public Object getValue(String propertyName) { - try { - return this.getClass() - .getMethod("get" + Character.toTitleCase(propertyName.charAt(0)) + propertyName.substring(1)) - .invoke(this); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - public void setValue(String propertyName, Object value) { - try { - String setterName = "set" + Character.toTitleCase(propertyName.charAt(0)) + propertyName.substring(1); - Method[] methods = this.getClass().getDeclaredMethods(); - for (Method method : methods) { - if (method.getName().equals(setterName)) { - Class<?> class1 = method.getParameterTypes()[0]; - method.invoke(this, class1.cast(value)); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - // Accessors - - public String getSecurityId() { - return this.securityId; - } - - public void setSecurityId(String securityId) { - this.securityId = securityId; - } - - public String getSecurityDescription() { - return this.securityDescription; - } - - public void setSecurityDescription(String securityDescription) { - this.securityDescription = securityDescription; - } - - public String getRating() { - return this.rating; - } - - public void setRating(String rating) { - this.rating = rating; - } - - public Date getIssueDate() { - return this.issueDate; - } - - public void setIssueDate(Date issueDate) { - this.issueDate = issueDate; - } - - public PricingTypeBean getPricingType() { - return this.pricingType; - } - - public void setPricingType(PricingTypeBean pricingType) { - this.pricingType = pricingType; - } - - public Double getBidPrice() { - return this.bidPrice; - } - - public void setBidPrice(Double bidPrice) { - this.bidPrice = bidPrice; - } - - public Double getAskPrice() { - return this.askPrice; - } - - public void setAskPrice(Double askPrice) { - this.askPrice = askPrice; - } - - public int getLotSize() { - return this.lotSize; - } - - public void setLotSize(int lotSize) { - this.lotSize = lotSize; - } - - public Boolean getPublishFlag() { - return this.publishFlag; - } - - public void setPublishFlag(Boolean publishFlag) { - this.publishFlag = publishFlag; - } - - public Double getHigh52Week() { - return this.high52Week; - } - - public void setHigh52Week(Double high52Week) { - this.high52Week = high52Week; - } - - public Double getLow52Week() { - return this.low52Week; - } - - public void setLow52Week(Double low52Week) { - this.low52Week = low52Week; - } - - public Double getEps() { - return this.eps; - } - - public void setEps(Double eps) { - this.eps = eps; - } - - public Double getVolume() { - return this.volume; - } - - public void setVolume(Double volume) { - this.volume = volume; - } - - public Double getMarketCap() { - return this.marketCap; - } - - public void setMarketCap(Double marketCap) { - this.marketCap = marketCap; - } - - public Double getInstitutionOwned() { - return this.institutionOwned; - } - - public void setInstitutionOwned(Double institutionOwned) { - this.institutionOwned = institutionOwned; - } - - public String[] getPropertyNames() { - return this.propertyNames; - } - - public static List<TableRowFixture> getList() { - List<TableRowFixture> listFixture = new ArrayList<TableRowFixture>(); - - listFixture.addAll(Arrays.asList( - new TableRowFixture("US" + getRandomNumber(), "B Ford Motor", "a", getRandomDate(), PRICING_MANUAL, 4.7912, 20, 1500000, true, 6.75, 1.01, -7.03, 114000000, 2000000000, 5000000000D), - new TableRowFixture("ABC" + getRandomNumber(), "A Alphabet Co.", "AAA", getRandomDate(), PRICING_AUTO, 1.23456, 10, 10000, true, 5.124, .506, 1.233, 2000000, 50000000, 4500000), - new TableRowFixture("US" + getRandomNumber(), "C General Electric Co", "B", getRandomDate(), PRICING_MANUAL, 10.1244, 30, 1500000, false, 30.74, 5.73, 1.62, 93350000, 142000000, 70000000), - new TableRowFixture("US" + getRandomNumber(), "E Nissan Motor Co., Ltd.", "AA", getRandomDate(), PRICING_MANUAL, 7.7891, 50, 80000, true, 17.97, 5.59, 0.50, 489000, 250000000, 250000), - new TableRowFixture("US" + getRandomNumber(), "D Toyota Motor Corp.", "aaa", getRandomDate(), PRICING_MANUAL, 62.5789, 40, 450000, true, 104.40, 55.41, -2.85, 849000, 1242000000, 2000000), - new TableRowFixture("US" + getRandomNumber(), "F Honda Motor Co., Ltd.", "aa", getRandomDate(), PRICING_MANUAL, 23.7125, 60, 6500000, false, 36.29, 17.35, -21.83, 1050000, 53000000, 70000), - new TableRowFixture("US" + getRandomNumber(), "G General Motors Corporation", "B-", getRandomDate(), PRICING_MANUAL, 2.9811, 70, 2585000, true, 18.18, .27, .110, 58714700, 25900000, 2800000), - new TableRowFixture("US" + getRandomNumber(), "H Yahoo! Inc", "C", getRandomDate(), PRICING_AUTO, 12.9811, 80, 99000, true, 26.86, 8.94, 0.00, 22000000, 22740000000D, 14000000000D), - new TableRowFixture("US" + getRandomNumber(), "I Microsoft", "BB", getRandomDate(), PRICING_AUTO, 22.5506, 90, 6250000, false, 29.57, 14.87, 1.74, 57000000, 196000000000D, 80000000000D), - new TableRowFixture("US" + getRandomNumber(), "J Google Inc.", "AAA", getRandomDate(), PRICING_AUTO, 330.9315, 100, 8550000, true, 579.10, 247.30, 13.67, 3000000, 136000000000D, 70000000000D), - new TableRowFixture("US" + getRandomNumber(), "K Research In Motion Limited", "AA", getRandomDate(), PRICING_MANUAL, 43.0311, 110, 55000, true, 150.30, 44.23, 3.67, 587295, 51000000000D, 0), - new TableRowFixture("US" + getRandomNumber(), "L Apple Inc.", "AAA", getRandomDate(), PRICING_AUTO, 102.4817, 120, 115000, false, 186.78, 78.20, 1.67, 17000000, 125000000000D, 14000000000D), - new TableRowFixture("US" + getRandomNumber(), "M Nokia Corp.", "A-", getRandomDate(), PRICING_AUTO, 12.0500, 130, 315000, true, 28.34, 8.47, 1.08, 17390000, 58400000000D, 10000000000D))); - - return listFixture; - } -} diff --git a/org.eclipse.nebula.widgets.nattable.parent/pom.xml b/org.eclipse.nebula.widgets.nattable.parent/pom.xml index 40c71ee3..152f3574 100644 --- a/org.eclipse.nebula.widgets.nattable.parent/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.parent/pom.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (c) 2012 Original authors and others. All rights reserved. - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v1.0 which accompanies this distribution, - and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: +<!-- Copyright (c) 2012 Original authors and others. All rights reserved. + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v1.0 which accompanies this distribution, + and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Original authors and others - initial API and implementation --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> @@ -32,8 +32,7 @@ <module>../org.eclipse.nebula.widgets.nattable.extension.poi.source.feature</module> <module>../org.eclipse.nebula.widgets.nattable.updatesite</module> - - <module>../org.eclipse.nebula.widgets.nattable.extension.builder</module> + <module>../org.eclipse.nebula.widgets.nattable.dataset</module> <module>../org.eclipse.nebula.widgets.nattable.examples</module> </modules> |