本文整理汇总了Java中org.eclipse.ui.console.IConsoleManager.getConsoles方法的典型用法代码示例。如果您正苦于以下问题:Java IConsoleManager.getConsoles方法的具体用法?Java IConsoleManager.getConsoles怎么用?Java IConsoleManager.getConsoles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.console.IConsoleManager
的用法示例。
在下文中一共展示了IConsoleManager.getConsoles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
public static PluginDependenciesConsole showConsole() {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
boolean exists = false;
if (console != null) {
IConsole[] existing = manager.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (console == existing[i]) {
exists = true;
}
}
} else {
console = new PluginDependenciesConsole("Plug-in Dependencies", null, true);
}
if (!exists) {
manager.addConsoles(new IConsole[] { console });
}
ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
theme.addPropertyChangeListener(console);
console.setConsoleFont();
manager.showConsoleView(console);
return console;
}
示例2: getConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的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: openConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
@Override
public void openConsole() {
console = getConsole();
if (console != null) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = manager.getConsoles();
boolean exists = false;
for (int i = 0; i < existing.length; i++) {
if(console == existing[i])
exists = true;
}
if(!exists)
manager.addConsoles(new IConsole[] {console});
manager.showConsoleView(console);
}
}
示例4: findConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
/**
* Fins the console with a given name
* @param name, name of the console
* @return
*/
private static MessageConsole findConsole(String name)
{
if (name == null)
{
throw new IllegalArgumentException("Console name must be not null");
}
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = consoleManager.getConsoles();
// try to find existing
for (int i = 0; i < existing.length; i++)
{
if (name.equals(existing[i].getName()))
{
return (MessageConsole) existing[i];
}
}
// no console found, create a new one
MessageConsole myConsole = new MessageConsole(name, null);
consoleManager.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例5: findConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
/**
* Finds the console with a given name.
*
* @param name, name of the console
* @return
*/
private static MessageConsole findConsole(String name)
{
if (name == null)
{
throw new IllegalArgumentException("Console name must be not null");
}
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = consoleManager.getConsoles();
// try to find existing
for (int i = 0; i < existing.length; i++)
{
if (name.equals(existing[i].getName()))
{
return (MessageConsole) existing[i];
}
}
// no console found, create a new one
MessageConsole myConsole = new MessageConsole(name, null);
consoleManager.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
示例6: showConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
public static void showConsole(IConsole console) {
if (console != null) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = manager.getConsoles();
boolean exists = false;
for (int i = 0; i < existing.length; i++) {
if (console == existing[i]) {
exists = true;
}
}
if (!exists) {
manager.addConsoles(new IConsole[] { console });
}
manager.showConsoleView(console);
}
}
示例7: findConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的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.IConsoleManager; //导入方法依赖的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;
}
示例9: showConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
private void showConsole() {
ChangeOutPutConsole console = VariantSyncPlugin.getDefault().getConsole();
if (console != null) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = manager.getConsoles();
boolean exist = false;
for (int i = 0; i < existing.length; i++) {
if (console == existing[i]) {
exist = true;
}
}
if (!exist) {
manager.addConsoles(new IConsole[] { console });
}
manager.showConsoleView(console);
}
}
示例10: findConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的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;
}
示例11: findConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的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;
}
示例12: showConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
public static JDependConsole showConsole() {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
boolean exists = false;
if (console != null) {
IConsole[] existing = manager.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (console == existing[i]) {
exists = true;
}
}
} else {
console = new JDependConsole("JDepend", null, true);
}
if (!exists) {
manager.addConsoles(new IConsole[] { console });
}
manager.showConsoleView(console);
return console;
}
示例13: findConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的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;
}
示例14: displayConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
/**
* Show the application console. If the given console is null, attempt
* to find an existing console and use it. If the given console is null
* and no existing consoles exist, exit without doing anything.
*
* @param myConsole An existing console.
*/
public static void displayConsole (IConsole myConsole) {
// try to grab any old console and display it if given null
if (myConsole == null) {
final ConsolePlugin plugin = ConsolePlugin.getDefault();
final IConsoleManager conMan = plugin.getConsoleManager();
final IConsole[] existing = conMan.getConsoles();
if (existing.length == 0)
return;
for (final IConsole element : existing)
myConsole = element;
}
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {myConsole});
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(myConsole);
}
示例15: getConsole
import org.eclipse.ui.console.IConsoleManager; //导入方法依赖的package包/类
private MessageConsole getConsole(String name) {
Activator plugin = Activator.getDefault();
IConsoleManager consoleManager = plugin.getConsoleManager();
IConsole[] existing = consoleManager.getConsoles();
LoggerUtil.logDebug("Consoles returned from ConsoleManager: " + existing.length);
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())) {
LoggerUtil.logDebug("Found console with name: " + name);
MessageConsole messageConsole = (MessageConsole) existing[i];
messageConsole.clearConsole();
return messageConsole;
}
}
LoggerUtil.logDebug("No console with name " + name + " was found, creating such..");
MessageConsole decompilerConsole = new MessageConsole(name, null);
consoleManager.addConsoles(new IConsole[] { decompilerConsole });
return decompilerConsole;
}