我想使用浏览器视图替换默认的控制台视图,以便控制台可以具有更多扩展。我的想法是通过实现org.eclipse.ui.console.consolePageParticipants
接口来强制替换。但是由于我失败了,最终失败了不知道如何替换它。我知道我的计划可能不正确,但是我没有想到更好的解决方案。谁可以提供一些想法。根据我目前的计划,仍然有一个未解决的地方,如何替换默认的控制台视图。
<extension point="org.eclipse.ui.console.consolePageParticipants">
<consolePageParticipant class="me.eclipse.plugin.ansiconsole.participants.AnsiConsolePageParticipant" id="me.eclipse.plugin.ansiconsole.participants.AnsiConsolePageParticipant">
<enablement>
<instanceof value="org.eclipse.ui.console.IConsole" />
</enablement>
</consolePageParticipant>
</extension>
public class AnsiConsolePageParticipant implements IConsolePageParticipant{
@Override
public <T> T getAdapter(Class<T> adapter) {
return null;
}
@Override
public void activated() {
// Nothing to do, but we are forced to implement it for IConsolePageParticipant
}
@Override
public void deactivated() {
// Nothing to do, but we are forced to implement it for IConsolePageParticipant
}
@Override
public void dispose() {
}
@Override
public void init(IPageBookViewPage page, IConsole console) {
//do forced replacement
}
}