mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52: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
d78fd29834
commit
770bad545c
4 changed files with 74 additions and 2 deletions
|
@ -20,6 +20,16 @@
|
|||
id="org.eclipse.tm.terminal.view.ui.TerminalsView"
|
||||
name="%TerminalsView.name">
|
||||
</view>
|
||||
|
||||
<!-- Contribute another view with the old ID to handle the ID change -->
|
||||
<view
|
||||
allowMultiple="true"
|
||||
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">
|
||||
</view>
|
||||
</extension>
|
||||
|
||||
<!-- Perspective extension contributions -->
|
||||
|
@ -128,7 +138,7 @@
|
|||
class="org.eclipse.tm.terminal.view.ui.internal.PropertyTester"
|
||||
id="org.eclipse.tm.terminal.view.ui.PropertyTester"
|
||||
namespace="org.eclipse.tm.terminal.view.ui"
|
||||
properties="hasApplicableLauncherDelegates,canDisconnect"
|
||||
properties="oldViewActivityEnabled,hasApplicableLauncherDelegates,canDisconnect"
|
||||
type="java.lang.Object">
|
||||
</propertyTester>
|
||||
</extension>
|
||||
|
@ -325,6 +335,23 @@
|
|||
<defaultEnablement
|
||||
id="org.eclipse.tm.terminal.view.ui.activity.views">
|
||||
</defaultEnablement>
|
||||
|
||||
<activity
|
||||
id="org.eclipse.tm.terminal.view.ui.activity.oldview"
|
||||
name="Terminal Views (Old)">
|
||||
<enabledWhen>
|
||||
<test
|
||||
property="org.eclipse.tm.terminal.view.ui.oldViewActivityEnabled"
|
||||
value="true">
|
||||
</test>
|
||||
</enabledWhen>
|
||||
</activity>
|
||||
|
||||
<activityPatternBinding
|
||||
activityId="org.eclipse.tm.terminal.view.ui.activity.oldview"
|
||||
pattern="org\.eclipse\.tm\.terminal\.view\.ui/org\.eclipse\.tcf\.te\.ui\.terminals\.TerminalsView">
|
||||
</activityPatternBinding>
|
||||
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.contexts">
|
||||
|
|
|
@ -31,6 +31,10 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
|
|||
@SuppressWarnings("cast")
|
||||
@Override
|
||||
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
|
||||
if ("oldViewActivityEnabled".equals(property)) { //$NON-NLS-1$
|
||||
return true;
|
||||
}
|
||||
|
||||
if ("hasApplicableLauncherDelegates".equals(property)) { //$NON-NLS-1$
|
||||
ISelection selection = receiver instanceof ISelection ? (ISelection)receiver : new StructuredSelection(receiver);
|
||||
return expectedValue.equals(Boolean.valueOf(LauncherDelegateManager.getInstance().getApplicableLauncherDelegates(selection).length > 0));
|
||||
|
|
|
@ -40,7 +40,7 @@ public class OldTerminalsViewHandler extends PerspectiveAdapter implements IStar
|
|||
if (page != null) handleOldTerminalsView(page);
|
||||
|
||||
// Register ourself as perspective listener
|
||||
window.addPerspectiveListener(this);
|
||||
if (window != null) window.addPerspectiveListener(this);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -69,6 +69,7 @@ public class OldTerminalsViewHandler extends PerspectiveAdapter implements IStar
|
|||
while (oldView != null) {
|
||||
page.hideView(oldView);
|
||||
showNewView = true;
|
||||
oldView = page.findView(OLD_VIEW_ID);
|
||||
}
|
||||
|
||||
// Show the new terminals view if necessary
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.view.ui.view;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class OldTerminalsViewHandler2 extends ViewPart {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public OldTerminalsViewHandler2() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
public void createPartControl(Composite parent) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
|
||||
*/
|
||||
@Override
|
||||
public void setFocus() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue