org.openide.util.Utilities.wrapStringToArray()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.openide.util.Utilities.wrapStringToArray()方法的一些代码示例,展示了Utilities.wrapStringToArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.wrapStringToArray()方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:wrapStringToArray

Utilities.wrapStringToArray介绍

[英]Wrap multi-line strings (and get the individual lines).
[中]包装多行字符串(并获取单独的行)。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Wrap multi-line strings.
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param breakIterator algorithm for breaking lines
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the whole string with embedded newlines
*/
public static String wrapString(String original, int width, BreakIterator breakIterator, boolean removeNewLines) {
  String[] sarray = wrapStringToArray(original, width, breakIterator, removeNewLines);
  StringBuilder retBuf = new StringBuilder();
  for (int i = 0; i < sarray.length; i++) {
    retBuf.append(sarray[i]);
    retBuf.append('\n');
  }
  return retBuf.toString();
}

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Wrap multi-line strings (and get the individual lines).
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
*                  if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
@Deprecated
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
  BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
  return wrapStringToArray(original, width, bi, removeNewLines);
}

代码示例来源:origin: org.netbeans.api/org-openide-util-ui

/** Wrap multi-line strings (and get the individual lines).
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
*                  if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
@Deprecated
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
  BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
  return wrapStringToArray(original, width, bi, removeNewLines);
}

代码示例来源:origin: in.jlibs/org-openide-util

/** Wrap multi-line strings.
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param breakIterator algorithm for breaking lines
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the whole string with embedded newlines
*/
public static String wrapString(String original, int width, BreakIterator breakIterator, boolean removeNewLines) {
  String[] sarray = wrapStringToArray(original, width, breakIterator, removeNewLines);
  StringBuffer retBuf = new StringBuffer();
  for (int i = 0; i < sarray.length; i++) {
    retBuf.append(sarray[i]);
    retBuf.append('\n');
  }
  return retBuf.toString();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Wrap multi-line strings.
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param breakIterator algorithm for breaking lines
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the whole string with embedded newlines
*/
public static String wrapString (String original, int width, BreakIterator breakIterator, boolean removeNewLines) {
  
  String[] sarray = wrapStringToArray(original, width, breakIterator, removeNewLines);
  StringBuffer retBuf = new StringBuffer ();
  
  for (int i = 0; i < sarray.length; i++) {
    retBuf.append (sarray[i]);
    retBuf.append ('\n');
  }
  return retBuf.toString ();
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

/** Wrap multi-line strings.
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param breakIterator algorithm for breaking lines
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the whole string with embedded newlines
*/
public static String wrapString(String original, int width, BreakIterator breakIterator, boolean removeNewLines) {
  String[] sarray = wrapStringToArray(original, width, breakIterator, removeNewLines);
  StringBuilder retBuf = new StringBuilder();
  for (int i = 0; i < sarray.length; i++) {
    retBuf.append(sarray[i]);
    retBuf.append('\n');
  }
  return retBuf.toString();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Wrap multi-line strings.
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param breakIterator algorithm for breaking lines
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the whole string with embedded newlines
*/
public static String wrapString (String original, int width, BreakIterator breakIterator, boolean removeNewLines) {
  
  String[] sarray = wrapStringToArray(original, width, breakIterator, removeNewLines);
  StringBuffer retBuf = new StringBuffer ();
  
  for (int i = 0; i < sarray.length; i++) {
    retBuf.append (sarray[i]);
    retBuf.append ('\n');
  }
  return retBuf.toString ();
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

/** Wrap multi-line strings (and get the individual lines).
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
*                  if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
@Deprecated
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
  BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
  return wrapStringToArray(original, width, bi, removeNewLines);
}

代码示例来源:origin: in.jlibs/org-openide-util

/** Wrap multi-line strings (and get the individual lines).
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
*                  if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
@Deprecated
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
  BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
  return wrapStringToArray(original, width, bi, removeNewLines);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Wrap multi-line strings (and get the individual lines).
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
*                  if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
  BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
  return wrapStringToArray(original, width, bi, removeNewLines);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Wrap multi-line strings (and get the individual lines).
* @param original  the original string to wrap
* @param width     the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
*                  if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
  BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
  return wrapStringToArray(original, width, bi, removeNewLines);
}

相关文章