mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
View: Bug 466644 - A "Could not create the view:" error appears after
updating from TCF Terminals to TM Terrminal
This commit is contained in:
parent
770bad545c
commit
b0c888065d
4 changed files with 33 additions and 6 deletions
|
@ -16,6 +16,7 @@ providerName = Eclipse.org - Target Management
|
|||
ViewCategory.name=Terminal
|
||||
|
||||
TerminalsView.name=Terminal
|
||||
TerminalsView.name.old=Terminal (Old)
|
||||
TerminalsView.context.name=In Terminal View
|
||||
TerminalsView.context.description=Show modified keyboard shortcuts in context menu
|
||||
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
class="org.eclipse.tm.terminal.view.ui.view.OldTerminalsViewHandler2"
|
||||
icon="icons/eview16/terminal_view.gif"
|
||||
id="org.eclipse.tcf.te.ui.terminals.TerminalsView"
|
||||
name="%TerminalsView.name"
|
||||
restorable="false">
|
||||
name="%TerminalsView.name.old">
|
||||
</view>
|
||||
</extension>
|
||||
|
||||
|
@ -349,9 +348,13 @@
|
|||
|
||||
<activityPatternBinding
|
||||
activityId="org.eclipse.tm.terminal.view.ui.activity.oldview"
|
||||
pattern="org\.eclipse\.tm\.terminal\.view\.ui/org\.eclipse\.tcf\.te\.ui\.terminals\.TerminalsView">
|
||||
pattern=".*/org\.eclipse\.tcf\.te\.ui\.terminals\.TerminalsView">
|
||||
</activityPatternBinding>
|
||||
|
||||
<categoryActivityBinding
|
||||
activityId="org.eclipse.tm.terminal.view.ui.activity.oldview"
|
||||
categoryId="org.eclipse.tm.terminal.view.ui.category">
|
||||
</categoryActivityBinding>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.contexts">
|
||||
|
|
|
@ -31,8 +31,9 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
|
|||
@SuppressWarnings("cast")
|
||||
@Override
|
||||
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
|
||||
// This property is supposed to return always false
|
||||
if ("oldViewActivityEnabled".equals(property)) { //$NON-NLS-1$
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ("hasApplicableLauncherDelegates".equals(property)) { //$NON-NLS-1$
|
||||
|
|
|
@ -10,17 +10,26 @@
|
|||
package org.eclipse.tm.terminal.view.ui.view;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.tm.terminal.view.ui.interfaces.IUIConstants;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
|
||||
/**
|
||||
*
|
||||
* Old terminals view handler implementation.
|
||||
* <p>
|
||||
* If invoked, the view implementation opens the new terminals view and
|
||||
* closes itself afterwards.
|
||||
*/
|
||||
public class OldTerminalsViewHandler2 extends ViewPart {
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor.
|
||||
*/
|
||||
public OldTerminalsViewHandler2() {
|
||||
super();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -28,6 +37,19 @@ public class OldTerminalsViewHandler2 extends ViewPart {
|
|||
*/
|
||||
@Override
|
||||
public void createPartControl(Composite parent) {
|
||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||
IWorkbenchPage page = window != null ? window.getActivePage() : null;
|
||||
|
||||
if (page != null) {
|
||||
// Show the new view
|
||||
try {
|
||||
page.showView(IUIConstants.ID);
|
||||
}
|
||||
catch (PartInitException e) { /* ignored on purpose */ }
|
||||
|
||||
// Hide ourself in the current perspective
|
||||
page.hideView(this);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue