本文整理汇总了Java中javax.swing.text.html.Option类的典型用法代码示例。如果您正苦于以下问题:Java Option类的具体用法?Java Option怎么用?Java Option使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Option类属于javax.swing.text.html包,在下文中一共展示了Option类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeOption
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Writes out the content of the Option form element.
* @param option an Option
* @exception IOException on any I/O error
*
*/
protected void writeOption(Option option) throws IOException {
indent();
write('<');
write("option");
// PENDING: should this be changed to check for null first?
Object value = option.getAttributes().getAttribute(HTML.Attribute.VALUE);
if (value != null) {
write(" value=" + value);
}
if (option.isSelected()) {
write(" selected");
}
write('>');
if (option.getLabel() != null) {
write(option.getLabel());
}
writeLineSeparator();
}
示例2: writeOption
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Writes out the content of the Option form element.
*
* @param option
* an Option
* @exception IOException
* on any I/O error
*
*/
protected void writeOption(Option option) throws IOException {
indent();
write('<');
write("option");
// PENDING: should this be changed to check for null first?
Object value = option.getAttributes().getAttribute(HTML.Attribute.VALUE);
if (value != null) {
write(" value=" + value);
}
if (option.isSelected()) {
write(" selected");
}
write('>');
if (option.getLabel() != null) {
write(option.getLabel());
}
writeLineSeparator();
}
示例3: selectContent
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Writes out the contents of a select element.
*
* @param attrSet the attrSet of the element to output as a select box
*
* @throws IOException on any I/O exceptions
*/
protected void selectContent(AttributeSet attrSet)
throws IOException
{
writeLineSeparator(); // Extra formatting to look more like the RI.
indent();
writeRaw("<select");
writeAttributes(attrSet);
writeRaw(">");
incrIndent();
writeLineSeparator(); // extra formatting to look more like the RI.
ComboBoxModel comboBoxModel =
(ComboBoxModel) attrSet.getAttribute(StyleConstants.ModelAttribute);
for (int i = 0; i < comboBoxModel.getSize(); i++)
{
writeOption((Option) comboBoxModel.getElementAt(i));
} // for(int i = 0; i < comboBoxModel.getSize(); i++)
decrIndent();
indent();
writeRaw("</select>");
}
示例4: writeOption
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Writes out the contents of an option element.
*
* @param option the option object to output as a select option
*
* @throws IOException on any I/O exceptions
*/
protected void writeOption(Option option)
throws IOException
{
indent();
writeRaw("<option");
writeAttributes(option.getAttributes());
writeRaw(">");
writeContent(option.getLabel());
writeRaw("</option>");
writeLineSeparator(); // extra formatting to look more like the RI.
}
示例5: writeOption
import javax.swing.text.html.Option; //导入依赖的package包/类
protected void writeOption(Option option) throws IOException {
writeLineSeparatorEnabled = false;
super.writeOption(option);
writeLineSeparatorEnabled = true;
write("</option>");
writeLineSeparator();
}
示例6: setInitialSelection
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Stores the Option that has been marked its selected attribute set.
*/
public void setInitialSelection(Option option) {
selectedOption = option;
}
示例7: setInitialSelection
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Stores the Option that has been marked its
* selected attribute set.
*/
public void setInitialSelection(Option option) {
selectedOption = option;
}
示例8: getInitialSelection
import javax.swing.text.html.Option; //导入依赖的package包/类
/**
* Fetches the Option item that represents that was
* initially set to a selected state.
*/
public Option getInitialSelection() {
return selectedOption;
}