blob: d615d79b2a2d32d4086485f172e4c0bef766641c [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2005, 2019 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.nico.ui;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.statet.jcommons.ts.core.Tool;
import org.eclipse.statet.nico.core.runtime.ToolProcess;
import org.eclipse.statet.nico.ui.console.NIConsole;
public class ToolSessionUIData {
private final ToolProcess fProcess;
private final NIConsole fConsole;
private final IWorkbenchPage fPage;
private final IViewPart fSource;
public ToolSessionUIData(final ToolProcess process, final NIConsole console,
final IWorkbenchPage page, final IViewPart source) {
fProcess = process;
fConsole = console;
fPage = page;
fSource = source;
}
public NIConsole getConsole() {
return fConsole;
}
public ToolProcess getProcess() {
return fProcess;
}
public IWorkbenchPage getPage() {
return fPage;
}
public IViewPart getSource() {
return fSource;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder(getClass().getName());
sb.append("\n\t"); //$NON-NLS-1$
sb.append("process= ").append(fProcess != null ? fProcess.getLabel(Tool.LONG_LABEL) : "<null>"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("\n\t"); //$NON-NLS-1$
sb.append("source= ").append(fSource != null ? fSource.getTitle() : "<null>"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("\n\t"); //$NON-NLS-1$
sb.append("console= ").append(fConsole != null ? fConsole.getName() : "<null>"); //$NON-NLS-1$ //$NON-NLS-2$
return sb.toString();
}
}