mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +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"
|
id="org.eclipse.tm.terminal.view.ui.TerminalsView"
|
||||||
name="%TerminalsView.name">
|
name="%TerminalsView.name">
|
||||||
</view>
|
</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>
|
</extension>
|
||||||
|
|
||||||
<!-- Perspective extension contributions -->
|
<!-- Perspective extension contributions -->
|
||||||
|
@ -128,7 +138,7 @@
|
||||||
class="org.eclipse.tm.terminal.view.ui.internal.PropertyTester"
|
class="org.eclipse.tm.terminal.view.ui.internal.PropertyTester"
|
||||||
id="org.eclipse.tm.terminal.view.ui.PropertyTester"
|
id="org.eclipse.tm.terminal.view.ui.PropertyTester"
|
||||||
namespace="org.eclipse.tm.terminal.view.ui"
|
namespace="org.eclipse.tm.terminal.view.ui"
|
||||||
properties="hasApplicableLauncherDelegates,canDisconnect"
|
properties="oldViewActivityEnabled,hasApplicableLauncherDelegates,canDisconnect"
|
||||||
type="java.lang.Object">
|
type="java.lang.Object">
|
||||||
</propertyTester>
|
</propertyTester>
|
||||||
</extension>
|
</extension>
|
||||||
|
@ -325,6 +335,23 @@
|
||||||
<defaultEnablement
|
<defaultEnablement
|
||||||
id="org.eclipse.tm.terminal.view.ui.activity.views">
|
id="org.eclipse.tm.terminal.view.ui.activity.views">
|
||||||
</defaultEnablement>
|
</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>
|
||||||
|
|
||||||
<extension point="org.eclipse.ui.contexts">
|
<extension point="org.eclipse.ui.contexts">
|
||||||
|
|
|
@ -31,6 +31,10 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
|
||||||
@SuppressWarnings("cast")
|
@SuppressWarnings("cast")
|
||||||
@Override
|
@Override
|
||||||
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
|
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$
|
if ("hasApplicableLauncherDelegates".equals(property)) { //$NON-NLS-1$
|
||||||
ISelection selection = receiver instanceof ISelection ? (ISelection)receiver : new StructuredSelection(receiver);
|
ISelection selection = receiver instanceof ISelection ? (ISelection)receiver : new StructuredSelection(receiver);
|
||||||
return expectedValue.equals(Boolean.valueOf(LauncherDelegateManager.getInstance().getApplicableLauncherDelegates(selection).length > 0));
|
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);
|
if (page != null) handleOldTerminalsView(page);
|
||||||
|
|
||||||
// Register ourself as perspective listener
|
// Register ourself as perspective listener
|
||||||
window.addPerspectiveListener(this);
|
if (window != null) window.addPerspectiveListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -69,6 +69,7 @@ public class OldTerminalsViewHandler extends PerspectiveAdapter implements IStar
|
||||||
while (oldView != null) {
|
while (oldView != null) {
|
||||||
page.hideView(oldView);
|
page.hideView(oldView);
|
||||||
showNewView = true;
|
showNewView = true;
|
||||||
|
oldView = page.findView(OLD_VIEW_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the new terminals view if necessary
|
// 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