Skip to content

Commit

Permalink
Added shorthand constraint syntax to the text mode layout
Browse files Browse the repository at this point in the history
  • Loading branch information
shai-almog committed Oct 21, 2019
1 parent f5acd53 commit 5217de2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CodenameOne/src/com/codename1/ui/layouts/TextModeLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ public TableLayout.Constraint createConstraint() {
return table.createConstraint().verticalAlign(Component.TOP);
}

/**
* Creates a new Constraint instance to add to the layout
*
* @return the default constraint
*/
public TableLayout.Constraint cc() {
return table.createConstraint().verticalAlign(Component.TOP);
}

/**
* Creates a new Constraint instance to add to the layout
*
Expand All @@ -195,6 +204,17 @@ public TableLayout.Constraint createConstraint(int row, int column) {
return table.createConstraint(row, column).verticalAlign(Component.TOP);
}

/**
* Creates a new Constraint instance to add to the layout
*
* @param row the row for the table starting with 0
* @param column the column for the table starting with 0
* @return the default constraint
*/
public TableLayout.Constraint cc(int row, int column) {
return table.createConstraint(row, column).verticalAlign(Component.TOP);
}

/**
* Automatically invokes the {@link com.codename1.ui.InputComponent#group(com.codename1.ui.Component...)}
* method on the text components in a BoxY layout scenario
Expand Down

0 comments on commit 5217de2

Please sign in to comment.