本文整理汇总了Java中org.eclipse.ui.console.MessageConsole.clearConsole方法的典型用法代码示例。如果您正苦于以下问题:Java MessageConsole.clearConsole方法的具体用法?Java MessageConsole.clearConsole怎么用?Java MessageConsole.clearConsole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.console.MessageConsole
的用法示例。
在下文中一共展示了MessageConsole.clearConsole方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private MessageConsole getConsole(String name) {
Activator plugin = Activator.getDefault();
IConsoleManager consoleManager = plugin.getConsoleManager();
IConsole[] existing = consoleManager.getConsoles();
LoggerUtil.logDebug("Consoles returned from ConsoleManager: " + existing.length);
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())) {
LoggerUtil.logDebug("Found console with name: " + name);
MessageConsole messageConsole = (MessageConsole) existing[i];
messageConsole.clearConsole();
return messageConsole;
}
}
LoggerUtil.logDebug("No console with name " + name + " was found, creating such..");
MessageConsole decompilerConsole = new MessageConsole(name, null);
consoleManager.addConsoles(new IConsole[] { decompilerConsole });
return decompilerConsole;
}
示例2: createWriteConsoleAction
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private Action createWriteConsoleAction(String actionName, final String consoleName, final Object content) {
return new Action(actionName) {
@Override
public void run() {
final MessageConsole console = findConsole(consoleName);
showConsole(console);
console.clearConsole();
/*
* From the Eclipse API: "Clients should avoid writing large
* amounts of output to this stream in the UI thread. The
* console needs to process the output in the UI thread and if
* the client hogs the UI thread writing output to the console,
* the console will not be able to process the output."
*/
new Thread(new Runnable() {
@Override
public void run() {
console.newMessageStream().println(content.toString());
}
}).start();
}
};
}
示例3: createWriteConsoleAction
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private Action createWriteConsoleAction(String actionName, final String consoleName,
final Object content) {
return new Action(actionName) {
@Override
public void run() {
final MessageConsole console = findConsole(consoleName);
showConsole(console);
console.clearConsole();
/*
* From the Eclipse API: "Clients should avoid writing large
* amounts of output to this stream in the UI thread. The
* console needs to process the output in the UI thread and if
* the client hogs the UI thread writing output to the console,
* the console will not be able to process the output."
*/
new Thread(new Runnable() {
@Override
public void run() {
console.newMessageStream().println(content.toString());
}
}).start();
}
};
}
示例4: initConsoleStream
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
/**
* Find console using name if exist or create new.
*
* @param name the console name
* @return console
*/
private void initConsoleStream() {
MessageConsole messageConsole = getMessageConsole();
messageConsole.clearConsole();
messageConsoleStream=messageConsole.newMessageStream();
logger.debug("Created message console stream");
messageConsoleStream.getConsole().addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
((ConsoleView)event.getSource()).setScrollLock(true);
}
});
}
示例5: createExportDOTAction
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private Action createExportDOTAction(final ClaimResult claim) {
return new Action("Show DOT Text in Console") {
@Override
public void run() {
MessageConsole console = findConsole("DOT Export");
showConsole(console);
console.clearConsole();
console.newMessageStream().println(ResoluteDOTUtils.claimToDOTText(claim));
}
};
}
示例6: addViewSupportConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private IAction addViewSupportConsole(String text, IMenuManager manager, AnalysisResult result) {
return new Action(text) {
public void run() {
Map<String, EObject> tempRefMap = linker.getReferenceMap(result.getParent());
if (tempRefMap == null) {
tempRefMap = linker.getReferenceMap(result);
}
final Map<String, EObject> refMap = tempRefMap;
final MessageConsole console = findConsole("Support");
Renaming tempRenaming = linker.getRenaming(result);
while(tempRenaming == null){
AnalysisResult parent = result.getParent();
if(parent == null){
throw new AgreeException("Problem finding renaming");
}
tempRenaming = linker.getRenaming(parent);
}
final Renaming renaming = tempRenaming;
showConsole(console);
console.clearConsole();
if (patternListener != null) {
console.removePatternMatchListener(patternListener);
}
patternListener = new AgreePatternListener(refMap);
console.addPatternMatchListener(patternListener);
new Thread(new Runnable() {
@Override
public void run() {
if (renaming instanceof AgreeRenaming) {
writeIvcResult(result, console, (AgreeRenaming)renaming);
}
}
}).start();
}
};
}
示例7: viewCexConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private void viewCexConsole(final Counterexample cex, final Layout layout, Map<String, EObject> refMap) {
final MessageConsole console = findConsole("Test Case");
showConsole(console);
console.clearConsole();
console.addPatternMatchListener(new AgreePatternListener(refMap));
/*
* From the Eclipse API: "Clients should avoid writing large amounts of
* output to this stream in the UI thread. The console needs to process
* the output in the UI thread and if the client hogs the UI thread
* writing output to the console, the console will not be able to
* process the output."
*/
new Thread(new Runnable() {
@Override
public void run() {
try (MessageConsoleStream out = console.newMessageStream()) {
for (String category : layout.getCategories()) {
if (isEmpty(category, cex, layout)) {
continue;
}
printHLine(out, cex.getLength());
out.println("Variables for " + category);
printHLine(out, cex.getLength());
out.print(String.format("%-60s", "Variable Name"));
for (int k = 0; k < cex.getLength(); k++) {
out.print(String.format("%-15s", k));
}
out.println();
printHLine(out, cex.getLength());
for (Signal<Value> signal : cex.getCategorySignals(layout, category)) {
// dont' print out values for properties
if (signal.getName().contains(":")) {
continue;
}
out.print(String.format("%-60s", "{" + signal.getName() + "}"));
for (int k = 0; k < cex.getLength(); k++) {
Value val = signal.getValue(k);
if (jkind.util.Util.isArbitrary(val)) {
out.print(String.format("%-15s", "-"));
} else {
out.print(String.format("%-15s", val.toString()));
}
}
out.println();
}
out.println();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}).start();
}
示例8: addViewTraceabilityConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private IAction addViewTraceabilityConsole(String text, IMenuManager manager, AnalysisResult result) {
return new Action(text) {
public void run() {
Map<String, EObject> tempRefMap = linker.getReferenceMap(result.getParent());
if (tempRefMap == null) {
tempRefMap = linker.getReferenceMap(result);
}
final Map<String, EObject> refMap = tempRefMap;
final MessageConsole console = findConsole("Traceability");
final Renaming renaming = linker.getRenaming(result);
showConsole(console);
console.clearConsole();
console.addPatternMatchListener(new AgreePatternListener(refMap));
new Thread(new Runnable() {
@Override
public void run() {
try {
MessageConsoleStream out = console.newMessageStream();
printHLine(out, 2);
out.println("Traceability for Valid Contract Guarantees");
printHLine(out, 2);
out.println("");
List<PropertyResult> allProperties = new ArrayList<PropertyResult>(
((JKindResult) result).getPropertyResults());
if (!allProperties.isEmpty()) {
for (PropertyResult prop : allProperties) {
if (prop.getStatus().equals(jkind.api.results.Status.VALID)) {
if (renaming instanceof AgreeRenaming) {
writeIvcResult(prop, console, (AgreeRenaming)renaming);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
};
}
示例9: viewCexConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private void viewCexConsole(final Counterexample cex, final Layout layout, Map<String, EObject> refMap) {
final MessageConsole console = findConsole("Counterexample");
showConsole(console);
console.clearConsole();
console.addPatternMatchListener(new AgreePatternListener(refMap));
/*
* From the Eclipse API: "Clients should avoid writing large amounts of
* output to this stream in the UI thread. The console needs to process
* the output in the UI thread and if the client hogs the UI thread
* writing output to the console, the console will not be able to
* process the output."
*/
new Thread(new Runnable() {
@Override
public void run() {
try (MessageConsoleStream out = console.newMessageStream()) {
for (String category : layout.getCategories()) {
if (isEmpty(category, cex, layout)) {
continue;
}
printHLine(out, cex.getLength());
if (category == "") {
out.println("Variables for the selected component implementation");
} else {
out.println("Variables for " + category);
}
printHLine(out, cex.getLength());
out.print(String.format("%-60s", "Variable Name"));
for (int k = 0; k < cex.getLength(); k++) {
out.print(String.format("%-15s", k));
}
out.println();
printHLine(out, cex.getLength());
for (Signal<Value> signal : cex.getCategorySignals(layout, category)) {
// dont' print out values for properties
if (signal.getName().contains(":")) {
continue;
}
out.print(String.format("%-60s", "{" + signal.getName() + "}"));
for (int k = 0; k < cex.getLength(); k++) {
Value val = signal.getValue(k);
if (jkind.util.Util.isArbitrary(val)) {
out.print(String.format("%-15s", "-"));
} else if (val instanceof NumericInterval) {
out.print(String.format("%-15s", formatInterval((NumericInterval) val)));
} else {
out.print(String.format("%-15s", val.toString()));
}
}
out.println();
}
out.println();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}).start();
}