Package org.eclipse.jst.pagedesigner.parts

Examples of org.eclipse.jst.pagedesigner.parts.TextEditPart


//    }

    // if a full Text node is selected,and the Text node is the only child
    // of its parent
    if ((startNode == endNode) && (startNode instanceof Text)) {
      TextEditPart part = (TextEditPart) ((INodeNotifier) startNode)
          .getAdapterFor(EditPart.class);
      boolean condition = false;
      if (start instanceof IDOMRefPosition
          || (start instanceof DOMPosition && !start.isText())) {
        condition = parentNode.getNodeName().equalsIgnoreCase(
            IHTMLConstants.TAG_P)
            && parentNode.getChildNodes().getLength() == 1;
      } else {
        condition = parentNode.getNodeName().equalsIgnoreCase(
            IHTMLConstants.TAG_P)
            && parentNode.getChildNodes().getLength() == 1
            && part.getTextData().length() == len;
      }
      if (condition) {
        // if uncheck the align action
        if (this.getApplyingNode()
            .getAttribute(IHTMLConstants.ATTR_ALIGN)
View Full Code Here


   * @param range
   * @return the select text if part is a text node or null.
   */
  public static String getSelectedText(EditPart part, DesignRange range) {
    if (part instanceof TextEditPart) {
      TextEditPart textPart = (TextEditPart) part;
      int[] offsets = textPart.getSelectedRange();
      String displayData = textPart.getTextData();

      String linkExp = displayData.substring(offsets[0], offsets[1]);
      return linkExp;
    }
    return null;
View Full Code Here

    return null;
  }

  public String getSourcePreview(EditPart part, DesignRange range) {
    if (part instanceof TextEditPart) {
      TextEditPart textPart = (TextEditPart) part;
      int[] offsets = textPart.getSelectedRange();
      String displayData = textPart.getTextData();

      String linkExp = displayData.substring(offsets[0], offsets[1]);
      StringBuffer sb = new StringBuffer();
      sb.append("<a href=\"\">"); //$NON-NLS-1$
      sb.append(linkExp);
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.parts.TextEditPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.