本文整理匯總了Java中org.eclipse.ui.console.MessageConsoleStream.print方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageConsoleStream.print方法的具體用法?Java MessageConsoleStream.print怎麽用?Java MessageConsoleStream.print使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.console.MessageConsoleStream
的用法示例。
在下文中一共展示了MessageConsoleStream.print方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: writeToConsole
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
* Displays the specified text at the console, followed by a line
* separator string.
*
* @param text message to display
* @param lineBreak <tt>true</tt> if a linebreak shall be inserted after the message.
* @return <tt>true</tt> if the message was successfully displayed inside the console.
*/
public boolean writeToConsole(String text, boolean lineBreak) {
boolean isWritten = false;
if (this.msgConsole != null) {
MessageConsoleStream out = this.msgConsole.newMessageStream();
if (lineBreak) {
out.println(text);
} else {
out.print(text);
}
try {
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return isWritten;
}
示例2: checkDescParameters
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
* Checks Description string.
* @param name the node name.
* @param desc the description.
*/
private void checkDescParameters(String name, String desc) {
Pattern p = Pattern.compile("\\{([^\\}]+)\\}"); //$NON-NLS-1$
ArrayList<String> paramList = new ArrayList<String>();
while (true) {
Matcher m = p.matcher(desc);
if (! m.find()) {
break;
}
String parameter = m.group(1);
paramList.add(parameter);
desc = desc.replaceAll(String.format(PARAM_ITEM_REGEX_FORMAT, parameter), ""); //$NON-NLS-1$
}
// found unknown parameters.
if (paramList.size() > 0) {
MessageConsoleStream stream = DcaseNodeEditPart.getMessageConsoleStream();
stream.print(name + ": cannot found "); //$NON-NLS-1$
for (int i = 0; i < paramList.size(); i++) {
stream.print(paramList.get(i) + ((i == paramList.size()-1) ? "":",")); //$NON-NLS-1$
}
stream.println();
}
}
示例3: printHLine
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
private void printHLine(MessageConsoleStream out, int nVars) {
out.print("--------------------------------------------------");
for (int k = 0; k < nVars; k++) {
out.print("---------------------");
}
out.println();
}
示例4: printHLine
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public static void printHLine(MessageConsoleStream out, int nVars) {
out.print("--------------------------------------------------");
for (int k = 0; k < nVars; k++) {
out.print("---------------------");
}
out.println();
}
示例5: print
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public void print(String line) throws IOException {
final MessageConsoleStream output = messageConsole.newMessageStream();
output.print(line);
output.close();
}