本文整理汇总了Java中javax.swing.event.DocumentEvent.EventType方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentEvent.EventType方法的具体用法?Java DocumentEvent.EventType怎么用?Java DocumentEvent.EventType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.event.DocumentEvent
的用法示例。
在下文中一共展示了DocumentEvent.EventType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendEvent
import javax.swing.event.DocumentEvent; //导入方法依赖的package包/类
/**
* Get string representation of an offset for debugging purposes
* in form "offset[line:column]". Both lines and columns start counting from 1
* like in the editor's status bar. Tabs are expanded when counting the column.
*
* @param sb valid string builder to which text will be appended or null in which case
* the method itself will create a string builder and it will return it.
* @param evt non-null document event.
* @return non-null string builder to which the description was added.
* @since 1.27
*/
public static StringBuilder appendEvent(StringBuilder sb, DocumentEvent evt) {
if (sb == null) {
sb = new StringBuilder(100);
}
DocumentEvent.EventType type = evt.getType();
sb.append(type).append(", ");
appendOffset(sb, evt.getDocument(), evt.getOffset());
sb.append(", l=").append(evt.getLength());
// Possibly append the modification text
String modText;
if ((modText = getModificationText(evt)) != null) {
sb.append(", modText=\"");
CharSequenceUtilities.debugText(sb, modText);
sb.append('"');
}
return sb;
}
示例2: BaseDocumentEvent
import javax.swing.event.DocumentEvent; //导入方法依赖的package包/类
/** Construct document event instance.
* @param offset position in the document where the insert/remove/change
* occured
* @param length number of the characters affected by the event
* @param type type of the event - INSERT/REMOVE/CHANGE
*/
public BaseDocumentEvent(BaseDocument doc, int offset, int length,
DocumentEvent.EventType type) {
((AbstractDocument)doc).super(offset, length, type);
hasBeenDone2 = true;
alive2 = true;
inProgress2 = true;
}
示例3: createDocumentEvent
import javax.swing.event.DocumentEvent; //导入方法依赖的package包/类
protected BaseDocumentEvent createDocumentEvent(int pos, int length,
DocumentEvent.EventType type) {
return new BaseDocumentEvent(this, pos, length, type);
}
示例4: getDocumentEvent
import javax.swing.event.DocumentEvent; //导入方法依赖的package包/类
final BaseDocumentEvent getDocumentEvent(int pos, int length, DocumentEvent.EventType type, AttributeSet attribs) {
BaseDocumentEvent bde = createDocumentEvent(pos, length, type);
bde.attachChangeAttribs(attribs);
return bde;
}
示例5: createDocumentEvent
import javax.swing.event.DocumentEvent; //导入方法依赖的package包/类
protected @Override BaseDocumentEvent createDocumentEvent(int offset, int length,
DocumentEvent.EventType type) {
return new GuardedDocumentEvent(this, offset, length, type);
}
示例6: GuardedDocumentEvent
import javax.swing.event.DocumentEvent; //导入方法依赖的package包/类
public GuardedDocumentEvent(GuardedDocument doc, int offset, int length,
DocumentEvent.EventType type) {
super(doc, offset, length, type);
}