本文整理匯總了Java中com.jgoodies.forms.layout.ColumnSpec.decodeSpecs方法的典型用法代碼示例。如果您正苦於以下問題:Java ColumnSpec.decodeSpecs方法的具體用法?Java ColumnSpec.decodeSpecs怎麽用?Java ColumnSpec.decodeSpecs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jgoodies.forms.layout.ColumnSpec
的用法示例。
在下文中一共展示了ColumnSpec.decodeSpecs方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: appendColumns
import com.jgoodies.forms.layout.ColumnSpec; //導入方法依賴的package包/類
/**
* Appends the given columns to this builder's layout.
* The columns to append are provided as a comma-separated
* string of column specifications. The string can be a format string
* and will then use the optional format arguments, see
* {@link String#format(String, Object...)}.<p>
*
* <strong>Examples:</strong><br>
* <pre>
* .appendColumns("50dlu, 3dlu, 50dlu")
* .appendColumns("%sdlu, 3dlu, %sdlu", "50") // Format string
* .appendColumns("$button, $rgap, $button") // Layout variable
* </pre>
*
* @param encodedColumnSpecs a comma-separated list of column specifications
* @param args optional format arguments
* @return a reference to this builder
*
* @see ColumnSpec
*/
public B appendColumns(String encodedColumnSpecs, Object... args) {
ColumnSpec[] newColumnSpecs = ColumnSpec.decodeSpecs(
Strings.get(encodedColumnSpecs, args), getLayoutMap());
for (ColumnSpec columnSpec : newColumnSpecs) {
getLayout().appendColumn(columnSpec);
}
return (B) this;
}
示例2: columns
import com.jgoodies.forms.layout.ColumnSpec; //導入方法依賴的package包/類
/**
* Configures this builder's layout columns using a comma-separated
* string of column specifications. The string can be a format string
* and will then use the optional format arguments, see
* {@link String#format(String, Object...)}.<p>
*
* <strong>Examples:</strong><br>
* <pre>
* .columns("left:90dlu, 3dlu, 200dlu")
* .columns("left:90dlu, 3dlu, %sdlu", "200") // Format string
* .columns("$label, $lcgap, 200dlu") // Layout variables
* </pre>
*
* @param encodedColumnSpecs a comma-separated list of column specifications
* @param args optional format arguments
* @return a reference to this builder
*
* @see ColumnSpec
*/
public B columns(String encodedColumnSpecs, Object... args) {
columnSpecs = ColumnSpec.decodeSpecs(
Strings.get(encodedColumnSpecs, args), getLayoutMap());
return (B) this;
}