Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called Multiple columns in slush bucket, by David Fasani

Title: Eclipse Community Forums
Subject: Multiple columns in slush bucket Author: David Fasani Date: Tue, 26 April 2016 09:29
Is it possible to display multiple columns within a slush bucket ?

Like SqlSchemaEditor FK example, i'm trying to add an index master detail node.

An index has a name property and an indexcolumn list :

@Image(path = "index.gif")
public interface Index extends Element {
	ElementType TYPE = new ElementType(Index.class);

	// *** Name ***

	@Label(standard = "index name")
	@Required
	@org.eclipse.sapphire.Unique
	@XmlBinding(path = "@name")

	ValueProperty PROP_NAME = new ValueProperty(TYPE, "Name");

	Value<String> getName();

	void setName(String name);

	
	// *** Columns ***

	@Type(base = IndexColumn.class)
	@XmlListBinding(mappings = @XmlListBinding.Mapping(element = "index-column", type = IndexColumn.class))
	@Length(min = 1, max = 32)
	@Service(impl = IndexValidationService.class)
	@Service(impl = IndexColumnNamePossibleValuesService.class)
	ListProperty PROP_INDEX_COLUMNS = new ListProperty(TYPE, "IndexColumns");

	ElementList<IndexColumn> getIndexColumns();

}


An IndexColumn holds a reference to an existing table column :

@Image(path = "Column.png")
public interface IndexColumn
    extends Element {

  ElementType TYPE = new ElementType(IndexColumn.class);

  // *** Name ***

  @Reference(target = Column.class)
  @ElementReference(list = "../../Columns", key = "Name")
  @Required
  @MustExist
  @Unique
  @XmlBinding(path = "@nameAttribute")
  @Service(impl = ColumnValueLabelService.class)

  ValueProperty PROP_COLUMN = new ValueProperty(TYPE, "Column");


  ReferenceValue<String, Column> getColumn();


  void setColumn(String value);


  void setColumn(Column value);



}



In a detail section I would like to display two properties of the referenced column in a slush bucket (name & description).
E.g. :


|    Name      |Description|                |    Name   |Description|
|--------------|-----------|                |-----------|-----------|  
|col1          | desc1     |                |           |           |
|col2          | desc2     |     --->       |           |           |
|col3          | desc3     |                |           |           |



Given the nested properties example, I tried -without success- to access directly to referenced column properties :

                                    <detail-section>
                                        <case>
                                            <content>
                                                <property-editor>
                                                    <show-label>false</show-label>
                                                    <property>IndexColumns</property>
                                                    <span>false</span>
                                                    <scale-vertically>true</scale-vertically>
                                                    <child-property>Column/Name</child-property>
                                                    <child-property>Column/Description</child-property>
                                                </property-editor>
                                            </content>
                                        </case>
                                        <property>Indexes</property>
                                        <scale-vertically>true</scale-vertically>
                                    </detail-section>



PS : Referencing the column property displays the table's column perfectly.

                                    <detail-section>
                                        <case>
                                            <content>
                                                <property-editor>
                                                    <show-label>false</show-label>
                                                    <property>IndexColumns</property>
                                                    <span>false</span>
                                                    <scale-vertically>true</scale-vertically>
                                                    <child-property>Column</child-property>
                                                </property-editor>
                                            </content>
                                        </case>
                                        <property>Indexes</property>
                                        <scale-vertically>true</scale-vertically>
                                    </detail-section>
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top