org.eclipse.debug.ui.console.IConsole Java Examples

The following examples show how to use org.eclipse.debug.ui.console.IConsole. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestDebugConfiguration.java    From corrosion with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testDebugLaunch() throws Exception {
	IProject project = getProject(BASIC_PROJECT_NAME);
	IFile file = project.getFile("src/main.rs");
	assertTrue(file.exists());
	RustDebugDelegate delegate = new RustDebugDelegate();
	delegate.launch(new StructuredSelection(project), "debug");
	assertEquals(Collections.emptyList(), errors);
	Assume.assumeTrue("rust-gdb not found, skipping test continuation", Runtime.getRuntime().exec("rust-gdb --version").waitFor() == 0);
	new DisplayHelper() {
		@Override
		protected boolean condition() {
			IConsole console = getApplicationConsole("basic");
			return (console != null && console.getDocument().get().contains("5 is positive")) || getErrorPopupMessage() != null;
		}
	}.waitForCondition(Display.getCurrent(), 15000);
	assertNull(getErrorPopupMessage());
	assertTrue(getApplicationConsole("basic").getDocument().get().contains("5 is positive"));
}
 
Example #2
Source File: PythonConsoleLineTracker.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void init(final IConsole console) {
    IProcess process = console.getProcess();
    if (process != null) {
        ILaunch launch = process.getLaunch();
        if (launch != null) {
            initLaunchConfiguration(launch.getLaunchConfiguration());
        }
    }
    this.linkContainer = new ILinkContainer() {

        @Override
        public void addLink(IHyperlink link, int offset, int length) {
            if (length <= 0) {
                // Log.log("Trying to create link with invalid len: " + length);
                return;
            }
            console.addLink(link, offset, length);
        }

        @Override
        public String getContents(int offset, int length) throws BadLocationException {
            return console.getDocument().get(offset, length);
        }
    };
}
 
Example #3
Source File: TestDebugConfiguration.java    From corrosion with Eclipse Public License 2.0 5 votes vote down vote up
static IConsole getApplicationConsole(String binaryName) {
	for (org.eclipse.ui.console.IConsole console : ConsolePlugin.getDefault().getConsoleManager().getConsoles()) {
		if (console instanceof IConsole && ((IConsole)console).getProcess().getLabel().endsWith(binaryName)) {
			return (IConsole)console;
		}
	}
	return null;
}
 
Example #4
Source File: BaseYankHandler.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * When called from a console context, use paste
 * 
 * @see com.mulgasoft.emacsplus.commands.IConsoleDispatch#consoleDispatch(org.eclipse.ui.console.TextConsoleViewer, org.eclipse.ui.console.IConsoleView, org.eclipse.core.commands.ExecutionEvent)
 */
public Object consoleDispatch(TextConsoleViewer viewer, IConsoleView activePart, ExecutionEvent event) {

	StyledText st = viewer.getTextWidget();
	try {
		// set directly from the widget
		widgetEol = st.getLineDelimiter();
		paste(event,st,activePart.getConsole() instanceof IConsole);
	} finally {
		st.redraw();
		widgetEol = null;
	}
	
	return null;
}
 
Example #5
Source File: ConsoleLineTracker.java    From ghidra with Apache License 2.0 4 votes vote down vote up
/**
 * @see org.eclipse.debug.ui.console.IConsoleLineTracker#init(org.eclipse.debug.ui.console.IConsole)
 */
@Override
public void init(IConsole console) {
	IProcess process = console.getProcess();
}
 
Example #6
Source File: ConsoleLineTracker.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
public void init(IConsole console) {
	IProcess process = console.getProcess();

	System.out.println(process.getLabel());
}
 
Example #7
Source File: JavadocConsoleLineTracker.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void init(IConsole console) {
	fConsole= console;
}