当前位置: 首页>>代码示例>>Java>>正文


Java Option类代码示例

本文整理汇总了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();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:26,代码来源:AltHTMLWriter.java

示例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();
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:29,代码来源:AltHTMLWriter.java

示例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>");

}
 
开发者ID:vilie,项目名称:javify,代码行数:32,代码来源:HTMLWriter.java

示例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.

}
 
开发者ID:vilie,项目名称:javify,代码行数:22,代码来源:HTMLWriter.java

示例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();
}
 
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:8,代码来源:XHTMLWriter.java

示例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;
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:7,代码来源:AltHTMLWriter.java

示例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;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:8,代码来源:AltHTMLWriter.java

示例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;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:8,代码来源:AltHTMLWriter.java


注:本文中的javax.swing.text.html.Option类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。