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


Java TextComponentPeer.getSelectionStart方法代码示例

本文整理汇总了Java中java.awt.peer.TextComponentPeer.getSelectionStart方法的典型用法代码示例。如果您正苦于以下问题:Java TextComponentPeer.getSelectionStart方法的具体用法?Java TextComponentPeer.getSelectionStart怎么用?Java TextComponentPeer.getSelectionStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.peer.TextComponentPeer的用法示例。


在下文中一共展示了TextComponentPeer.getSelectionStart方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeObject

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:TextComponent.java

示例2: writeObject

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException 
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:34,代码来源:TextComponent.java

示例3: removeNotify

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Removes the <code>TextComponent</code>'s peer.
 * The peer allows us to modify the appearance of the
 * <code>TextComponent</code> without changing its
 * functionality.
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            text = peer.getText();
            selectionStart = peer.getSelectionStart();
            selectionEnd = peer.getSelectionEnd();
        }
        super.removeNotify();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:TextComponent.java

示例4: getSelectionStart

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Gets the start position of the selected text in
 * this text component.
 * @return      the start position of the selected text
 * @see         java.awt.TextComponent#setSelectionStart
 * @see         java.awt.TextComponent#getSelectionEnd
 */
public synchronized int getSelectionStart() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        selectionStart = peer.getSelectionStart();
    }
    return selectionStart;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:TextComponent.java

示例5: removeNotify

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Removes the {@code TextComponent}'s peer.
 * The peer allows us to modify the appearance of the
 * {@code TextComponent} without changing its
 * functionality.
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            text = peer.getText();
            selectionStart = peer.getSelectionStart();
            selectionEnd = peer.getSelectionEnd();
        }
        super.removeNotify();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:TextComponent.java

示例6: getSelectionStart

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Returns the starting position of the selected text region.
 * If the text is not selected then caret position is returned.
 *
 * @return The starting position of the selected text region.
 */
public synchronized int getSelectionStart()
{
  TextComponentPeer tcp = (TextComponentPeer) getPeer();
  if (tcp != null)
    selectionStart = tcp.getSelectionStart();

  return(selectionStart);
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:TextComponent.java

示例7: getSelectionStart

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
 * Returns the starting position of the selected text region.
 * If the text is not selected then caret position is returned. 
 *
 * @return The starting position of the selected text region.
 */
public synchronized int getSelectionStart()
{
  TextComponentPeer tcp = (TextComponentPeer) getPeer();
  if (tcp != null)
    selectionStart = tcp.getSelectionStart();

  return(selectionStart);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:15,代码来源:TextComponent.java

示例8: removeNotify

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
    * Removes the <code>TextComponent</code>'s peer.
    * The peer allows us to modify the appearance of the 
    * <code>TextComponent</code> without changing its
    * functionality.
    */
   public void removeNotify() {
       synchronized (getTreeLock()) {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
	selectionStart = peer.getSelectionStart();
	selectionEnd = peer.getSelectionEnd();
    }
    super.removeNotify();
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:18,代码来源:TextComponent.java

示例9: getSelectionStart

import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
    * Gets the start position of the selected text in 
    * this text component. 
    * @return      the start position of the selected text 
    * @see         java.awt.TextComponent#setSelectionStart
    * @see         java.awt.TextComponent#getSelectionEnd
    */
   public synchronized int getSelectionStart() {
TextComponentPeer peer = (TextComponentPeer)this.peer;
if (peer != null) {
    selectionStart = peer.getSelectionStart();
}
return selectionStart;
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:15,代码来源:TextComponent.java


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