本文整理汇总了Java中org.eclipse.ui.console.ConsolePlugin.getDefault方法的典型用法代码示例。如果您正苦于以下问题:Java ConsolePlugin.getDefault方法的具体用法?Java ConsolePlugin.getDefault怎么用?Java ConsolePlugin.getDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.console.ConsolePlugin
的用法示例。
在下文中一共展示了ConsolePlugin.getDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: partOpened
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
@Override
public void partOpened(IWorkbenchPart part) {
super.partOpened(part);
if (getComponentCanvas() != null) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
String consoleName = getComponentCanvas().getActiveProject() + "." + getComponentCanvas().getJobName();
IConsole consoleToShow = getConsole(consoleName, conMan);
if (consoleToShow != null) {
// Fix for : Console window is getting displayed if user maximize canvas window and then try to create new job (Ctrl+J)
// conMan.showConsoleView(consoleToShow);
} else {
addDummyConsole();
}
}
}
示例2: getConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
/**
* Get the console with the given name. If the console does not exist, then
* a new one is created.
*
* @param name
* @return
*/
public static MessageConsole getConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())) {
return (MessageConsole) existing[i];
}
}
// no console found, so create a new one
MessageConsole console = new MessageConsole(name, null);
conMan.addConsoles(new IConsole[] { console });
// create a new logger handler
Logger.addHandler(new EclipseConsoleHandler(console));
return console;
}
示例3: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private MessageConsole findConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
// search existing consoles
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())){
return (MessageConsole) existing[i];
}
}
// no console found, so create a new one
MessageConsole myConsole = new MessageConsole(name, null);
conMan.addConsoles(new IConsole[]{myConsole});
conMan.showConsoleView(myConsole);
return myConsole;
}
示例4: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one
if (ConsolePlugin.getDefault() == null)
return null;
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager YangConsole = plugin.getConsoleManager();
IConsole[] existing = YangConsole.getConsoles();
for (int i = 0; i < existing.length; i++)
if (name.equals(existing[i].getName())) {
YangConsole.showConsoleView(existing[i]);
return (MessageConsole) existing[i];
}
MessageConsole myConsole = new MessageConsole(name, null);
YangConsole.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例5: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one
if (ConsolePlugin.getDefault() == null)
return null;
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager YangConsole = plugin.getConsoleManager();
IConsole[] existing = YangConsole.getConsoles();
for (int i = 0; i < existing.length; i++)
if (name.equals(existing[i].getName())) {
YangConsole.showConsoleView(existing[i]);
return (MessageConsole) existing[i];
}
MessageConsole myConsole = new MessageConsole(name, null);
YangConsole.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例6: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one
if (ConsolePlugin.getDefault() == null)
return null;
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager YangConsole = plugin.getConsoleManager();
IConsole[] existing = YangConsole.getConsoles();
for (int i = 0; i < existing.length; i++)
if (name.equals(existing[i].getName())) {
YangConsole.showConsoleView(existing[i]);
return (MessageConsole) existing[i];
}
// no console found, so create a new one
MessageConsole myConsole = new MessageConsole(name, null);
YangConsole.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例7: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one
if (ConsolePlugin.getDefault() == null)
return null;
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager YangConsole = plugin.getConsoleManager();
IConsole[] existing = YangConsole.getConsoles();
for (int i = 0; i < existing.length; i++)
if (name.equals(existing[i].getName())) {
YangConsole.showConsoleView(existing[i]);
return (MessageConsole) existing[i];
}
MessageConsole myConsole = new MessageConsole(name, null);
YangConsole.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例8: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one
if (ConsolePlugin.getDefault() == null)
return null;
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager YangConsole = plugin.getConsoleManager();
IConsole[] existing = YangConsole.getConsoles();
for (int i = 0; i < existing.length; i++)
if (name.equals(existing[i].getName())) {
YangConsole.showConsoleView(existing[i]);
return (MessageConsole) existing[i];
}
MessageConsole myConsole = new MessageConsole(name, null);
YangConsole.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例9: createConsoles
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private void createConsoles() {
ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
IConsoleManager consoleManager = consolePlugin.getConsoleManager();
stdoutConsole = new MessageConsole("Stdout", ImageDescriptor.createFromFile(getClass(), "/consoles/stdout.gif"));
stdoutConsole.setTabWidth(TAB_WIDTH);
stdoutConsoleStream = stdoutConsole.newMessageStream();
stderrConsoleStream = stdoutConsole.newMessageStream();
stderrConsoleStream.setColor(stderrConsoleStreamColor);
engineConsole = new MessageConsole("Engine", ImageDescriptor.createFromFile(getClass(), "/consoles/engine.gif"));
engineConsole.setTabWidth(TAB_WIDTH);
engineConsoleStream = engineConsole.newMessageStream();
consoleManager.addConsoles(new IConsole[] {
engineConsole,
stdoutConsole
});
consolePipes = new ConsolePipes();
debugConsoleStream = new MessageConsoleStream(engineConsole) {
@Override
public void write(String str) throws IOException {
if (str.endsWith("\n")) {
str = str.substring(0, str.length() - 1);
}
Engine.logStudio.info("[debug] " + str);
}
};
}
示例10: getConsoleManager
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
/**
*
* get default console manager
*
* @return ConsoleManager
*/
private IConsoleManager getConsoleManager() {
ConsolePlugin plugin = ConsolePlugin.getDefault();
logger.debug("Retrieved Console plugin object");
IConsoleManager conMan = plugin.getConsoleManager();
logger.debug("Retrieved Console manager");
return conMan;
}
示例11: addDummyConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private void addDummyConsole() {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole consoleToShow = getConsole(DEFAULT_CONSOLE, conMan);
if (consoleToShow == null) {
consoleToShow = createNewMessageConsole(DEFAULT_CONSOLE, conMan);
}
// Fix for : Console window is getting displayed if user maximize canvas window and then try to create new job (Ctrl+J)
// conMan.showConsoleView(consoleToShow);
}
示例12: addDummyConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private void addDummyConsole(){
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager consoleManager = plugin.getConsoleManager();
IConsole consoleToShow = getConsole(DEFAULT_CONSOLE, consoleManager);
if(consoleToShow == null){
consoleToShow = createNewMessageConsole(DEFAULT_CONSOLE,consoleManager);
}
// Fix for : Console window is getting displayed if user maximize canvas window and then try to create new job (Ctrl+J)
// consoleManager.showConsoleView(consoleToShow);
}
示例13: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private MessageConsole findConsole(final String name) {
final ConsolePlugin plugin = ConsolePlugin.getDefault();
final IConsoleManager conMan = plugin.getConsoleManager();
final IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())) {
return (MessageConsole) existing[i];
}
}
// no console found, so create a new one
final MessageConsole myConsole = new MessageConsole(name, null);
conMan.addConsoles(new IConsole[] {myConsole});
return myConsole;
}
示例14: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private MessageConsole findConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName()))
return (MessageConsole) existing[i];
}
//no console found, so create a new one
MessageConsole myConsole = new MessageConsole(name, null);
conMan.addConsoles(new IConsole[]{myConsole});
return myConsole;
}
示例15: findConsole
import org.eclipse.ui.console.ConsolePlugin; //导入方法依赖的package包/类
private EGradleSystemConsole findConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())) {
return (EGradleSystemConsole) existing[i];
}
}
// no console found, so create a new one
EGradleSystemConsole myConsole = createConsole(name, conMan);
return myConsole;
}