GridData viewerData = new GridData(GridData.FILL_BOTH);
viewer.getControl().setLayoutData(viewerData);
viewer.setEditable(false);
-
+
StyledText widget = viewer.getTextWidget();
widget.setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
Action cutAction = new Action() {
// viewer.setDocument(document);
}
- /**
- * Prints out the string represented by the string buffer
- */
- public static void write(String output) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- PHPConsole console = (PHPConsole) page.findView(PHPConsole.CONSOLE_ID);
+ public static PHPConsole getInstance() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ PHPConsole console = (PHPConsole) page.findView(PHPConsole.CONSOLE_ID);
+ if (console == null) {
+ console = (PHPConsole) page.findView(PHPConsole.CONSOLE_ID);
+ }
+ if (PHPeclipsePlugin.getDefault().getPreferenceStore().getBoolean(PHPeclipsePlugin.SHOW_OUTPUT_IN_CONSOLE) == true) {
- if (console != null) {
- console.appendOutputText(output);
- } else if (PHPeclipsePlugin.getDefault().getPreferenceStore().getBoolean(PHPeclipsePlugin.SHOW_OUTPUT_IN_CONSOLE) == true) {
+ try {
page.showView(PHPConsole.CONSOLE_ID);
- console = (PHPConsole) page.findView(PHPConsole.CONSOLE_ID);
- console.setOutputText(output);
+ } catch (PartInitException e) {
+ PHPeclipsePlugin.getDefault().getLog().log(
+ new Status(
+ IStatus.ERROR,
+ PHPeclipsePlugin.getPluginId(),
+ 0,
+ PHPActionMessages.getString("PHPStartApacheAction.consoleViewOpeningProblem"),
+ e));
}
- } catch (PartInitException e) {
- PHPeclipsePlugin.getDefault().getLog().log(
- new Status(
- IStatus.ERROR,
- PHPeclipsePlugin.getPluginId(),
- 0,
- PHPActionMessages.getString("PHPStartApacheAction.consoleViewOpeningProblem"),
- e));
+
}
+ return console;
+ }
+ /**
+ * Prints out the string represented by the string buffer
+ */
+ public synchronized void write(String output) {
+ appendOutputText(output);
}
/**