當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageConsoleStream.println方法代碼示例

本文整理匯總了Java中org.eclipse.ui.console.MessageConsoleStream.println方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageConsoleStream.println方法的具體用法?Java MessageConsoleStream.println怎麽用?Java MessageConsoleStream.println使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.console.MessageConsoleStream的用法示例。


在下文中一共展示了MessageConsoleStream.println方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
@Override
public Object execute(ExecutionEvent event) {
	
	try {
		this.showConsole(event);
		this.clearConsole();
		
		IFile file = this.getSelectedFile(event);
		String umlModelPath = file.getLocation().toFile().getAbsolutePath();
		String toscaModelPath = file.getLocation().toFile().getAbsolutePath();
		toscaModelPath = toscaModelPath.replace(".uml", ".tosca");
		
		MessageConsoleStream outStream = console.newMessageStream();
		outStream.println("Translating " + umlModelPath + " into " + toscaModelPath);
		
		CAML2TOSCALauncher launcher = new CAML2TOSCALauncher();
		launcher.runCAML2TOSCATemplates(umlModelPath, toscaModelPath);
		
		outStream.println("Done ;)");
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
	
	return null;
}
 
開發者ID:alexander-bergmayr,項目名稱:caml2tosca,代碼行數:26,代碼來源:C2TRunHandler.java

示例2: run

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public void run() {
	try {
		ISelection selection = treeViewer.getSelection();
		Object obj = ((IStructuredSelection) selection).getFirstElement();

		if (obj instanceof Test) {
			if (((Test) obj).getStatus().equals("Actual run")) {
				((Test) obj).setStatus("Not run");
				treeViewer.refresh();
				treeViewer.expandAll();

				Runtime.getRuntime().exec("taskkill /F /IM python.exe");
				MessageConsoleStream out = ConsoleManager
						.getMessageConsoleStream("Console");
				out.println("Test Stop");
				
				runTestAction.setEnabled(true);
				this.setEnabled(false);
			}
		}

	} catch (IOException e) {
		e.printStackTrace();
	}

}
 
開發者ID:FutureProcessing,項目名稱:RFRunnerPlugin,代碼行數:27,代碼來源:StopTestAction.java

示例3: 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;
}
 
開發者ID:SSEHUB,項目名稱:EASyProducer,代碼行數:27,代碼來源:EclipseConsole.java

示例4: 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();
	}
}
 
開發者ID:d-case,項目名稱:d-case_editor,代碼行數:28,代碼來源:BasicNodeOpenEditPolicy.java

示例5: printError

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
 * Prints error message to the console.
 * 
 * @param message error message to print
 */
public static void printError(final String message) {
	final Display display = PlatformUI.getWorkbench().getDisplay();
	final MessageConsoleStream consoleStream = getConsoleStream();
	final Color color = new Color(display, new RGB(255, 0, 0));
	
	consoleStream.setColor(color);
	consoleStream.println(message);
}
 
開發者ID:SAP,項目名稱:hybris-commerce-eclipse-plugin,代碼行數:14,代碼來源:ConsoleUtils.java

示例6: run

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public void run() {
	try {
		BufferedReader br = new BufferedReader(new InputStreamReader(
				inputStream));
		String line = null;
		MessageConsoleStream out = ConsoleManager
				.getMessageConsoleStream("Console");
		while ((line = br.readLine()) != null) {
			out.println(line);
			actualRunTest.setEndTime(System.currentTimeMillis());

			if (line.contains("PASS") || (line.contains("FAIL"))) {
				if (line.contains("PASS")) {
					actualRunTest.setStatus("Passed");
				} else if (line.contains("FAIL")) {
					actualRunTest.setStatus("Failed");
				}
				
				treeContentProvider.updateTest(actualRunTest);
				runTestAction.setEnabled(true);
				stopTestAction.setEnabled(false);
				refresh();
			}
		}
	} catch (IOException ioe) {
		ioe.printStackTrace();
	}
}
 
開發者ID:FutureProcessing,項目名稱:RFRunnerPlugin,代碼行數:29,代碼來源:StreamWrapper.java

示例7: run

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public void run() {
	loadPluginSettings();
	
	MessageConsoleStream out = ConsoleManager
			.getMessageConsoleStream("Console");
	out.println("");

	ISelection selection = treeViewer.getSelection();
	Object obj = ((IStructuredSelection) selection)
			.getFirstElement();

	if (obj instanceof Test) {
		Runtime rt = Runtime.getRuntime();
		StreamWrapper output;

		try {
			Test selectedTest = (Test) obj;
			String testName = selectedTest.getTestName();
			String filePath = selectedTest.getFile().getPath();
			String pybotCommand = new StringBuilder(pybotPath)
					.append(" --test ").append('"')
					.append(testName).append('"').append(' ')
					.append(filePath).toString();
			Process proc = rt.exec(pybotCommand);
			output = new StreamWrapper(proc.getInputStream(),
					(Test) obj, treeViewer, treeContentProvider, this, stopTestAction);
			selectedTest.setStatus("Actual run");
			selectedTest.setStartTime(System.currentTimeMillis());
			output.start();

			treeViewer.refresh();
			treeViewer.expandAll();
		} catch (IOException e) {
			e.printStackTrace();
		}

		this.setEnabled(false);
		stopTestAction.setEnabled(true);
	}
}
 
開發者ID:FutureProcessing,項目名稱:RFRunnerPlugin,代碼行數:41,代碼來源:RunTestAction.java

示例8: showConsole

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public static void showConsole(String consoleName, String content) throws IOException, PartInitException{
	IWorkbenchPage page = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage();
	MessageConsole console = ConsoleHelper
			.findConsole(consoleName);
	MessageConsoleStream out = console.newMessageStream();
	out.println(content);
	out.setActivateOnWrite(true);
	out.setColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
	out.close();
	
	IConsoleView view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
	view.display(console);
}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:15,代碼來源:ViewHelper.java

示例9: run

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
 * Write the names of all files to be checked into a file-of-file-names(fofn) and
 * then call the Checker Framework in "check-only" mode to check the files
 * listed in the fofn
 */
public void run()
{
    try {
        MessageConsoleStream out = CheckerPlugin.findConsole().newMessageStream();

        final File srcFofn       = PluginUtil.writeTmpSrcFofn("CFPlugin-eclipse", true, PluginUtil.toFiles(fileNames));
        final File classpathFofn = PluginUtil.writeTmpCpFile("CFPlugin-eclipse", true,  classpath);

        final List<String> cmd = createCommand(srcFofn, processors, classpathFofn, bootClasspath, new PrintStream(out));

        if (verbose) {
            out.println(PluginUtil.join(" ", cmd));
            out.println();
            out.println("Classpath:    \n\t" + classpath + "\n");
            out.println("Source Files: \n\t" + PluginUtil.join("\n\t", fileNames));
        }

        final String [] cmdArr = cmd.toArray(new String[cmd.size()]);
        checkResult = Command.exec(cmdArr);

        if (verbose) {
            printTrimmedOutput(out, checkResult);
            out.println("\n*******************\n");
        }

        srcFofn.delete();
        classpathFofn.delete();
    } catch (IOException e) {
        CheckerPlugin.logException(e, "Error calling javac");
    }
}
 
開發者ID:reprogrammer,項目名稱:checker-framework,代碼行數:37,代碼來源:CommandlineJavacRunner.java

示例10: printTrimmedOutput

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public static void printTrimmedOutput(final MessageConsoleStream out, final String output) {

        List<String> lines = Arrays.asList(output.split(Util.NL));
        for( final String line : lines ) {
            out.println(JavacError.trimDetails(line));
        }
    }
 
開發者ID:reprogrammer,項目名稱:checker-framework,代碼行數:8,代碼來源:CommandlineJavacRunner.java

示例11: 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();
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:8,代碼來源:TestCaseGeneratorMenuListener.java

示例12: 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();
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:8,代碼來源:AgreeMenuListener.java

示例13: parameterListToString

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
 * Converts parameter list to string.
 * @param paramList the parameter list.
 * @return the string of parameter list.
 */
protected String parameterListToString(List<ParameterData> paramList) {
	Collections.sort(paramList, new ParameterComparator());
	StringBuffer ret = new StringBuffer();
	ArrayList<String> nameList = null;
	int prevdist = -1;
	
	for (int i = 0; i < paramList.size(); i++) {
		ParameterData curData = paramList.get(i);
		/* check duplicate parameter */
		if (curData.getDistance() != prevdist) {
			nameList = new ArrayList<String>();
			prevdist = curData.getDistance();
		}
		String parameters = curData.getValues();
		if (parameters == null || parameters.length() == 0) {
			continue;
		}
		for (ParameterItem item : ParameterItem.getPatameterList(parameters)) {
			String name = item.getParameterId();
			if (nameList.contains(name)) {
				MessageConsoleStream stream = getMessageConsoleStream();
				stream.println(NLS.bind(Messages.ParameterDuplicated, name));
			} else {
				nameList.add(name);
			}
		}
		ret.append(curData.getValues());
		if (i < paramList.size() - 1) {
			ret.append(ParameterItem.SEPARATOR);
		}
	}
	return ret.toString();
}
 
開發者ID:d-case,項目名稱:d-case_editor,代碼行數:39,代碼來源:DcaseNodeEditPart.java

示例14: printToPluginConsole

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public static boolean printToPluginConsole(String message) {
	if(message == null || message.length() == 0) {
		return false;
	}
	MessageConsole myConsole = findConsole();
	MessageConsoleStream out = myConsole.newMessageStream();		
	out.println(message);
	showPluginConsole();
	return true;
}
 
開發者ID:jplandrain,項目名稱:djeclipse,代碼行數:11,代碼來源:Activator.java

示例15: consoleWrite

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public static void consoleWrite(String msg) {
    console = getConsole();
    MessageConsoleStream out = console.newMessageStream();
    out.println(msg);
}
 
開發者ID:Ericsson,項目名稱:CodeCheckerEclipsePlugin,代碼行數:6,代碼來源:ConsoleFactory.java


注:本文中的org.eclipse.ui.console.MessageConsoleStream.println方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。