Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 235946 Details for
Bug 418298
F3 should always open the selected element in its corresponding editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for Bug 418298
0001-F3-now-always-available.patch (text/plain), 8.37 KB, created by
Sebastian Struckmann
on 2013-09-30 03:49:35 EDT
(
hide
)
Description:
Patch for Bug 418298
Filename:
MIME Type:
Creator:
Sebastian Struckmann
Created:
2013-09-30 03:49:35 EDT
Size:
8.37 KB
patch
obsolete
>From 4b0428dbea4019348818065c9bb5a9c8065a848d Mon Sep 17 00:00:00 2001 >From: Sebastian Struckmann <sebastian.struckmann@bredex.de> >Date: Thu, 26 Sep 2013 14:05:05 +0200 >Subject: [PATCH] F3 now available for SpecTCs > >F3 now available for TestJobs and TestSuites > >F3 not enabled when selected node is the root in an editor >--- > org.eclipse.jubula.client.ui.rcp/plugin.xml | 20 +++++- > .../handlers/open/OpenSpecificationHandler.java | 22 ++++++- > .../propertytester/SelectionPropertyTester.java | 75 ++++++++++++++++++++++ > 3 files changed, 112 insertions(+), 5 deletions(-) > create mode 100644 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/SelectionPropertyTester.java > >diff --git a/org.eclipse.jubula.client.ui.rcp/plugin.xml b/org.eclipse.jubula.client.ui.rcp/plugin.xml >index 4731b1f..1a81ebb 100644 >--- a/org.eclipse.jubula.client.ui.rcp/plugin.xml >+++ b/org.eclipse.jubula.client.ui.rcp/plugin.xml >@@ -151,6 +151,13 @@ > properties="hasImage" > type="org.eclipse.jubula.client.core.model.TestResultNode"> > </propertyTester> >+ <propertyTester >+ class="org.eclipse.jubula.client.ui.rcp.propertytester.SelectionPropertyTester" >+ id="org.eclipse.jubula.client.ui.rcp.propertytester.SelectionPropertyTester" >+ namespace="org.eclipse.jubula.client.ui.rcp.Selection" >+ properties="isNotRootInEditor" >+ type="org.eclipse.jubula.client.core.model.INodePO"> >+ </propertyTester> > </extension> > <extension > id="jbMarker" >@@ -3507,15 +3514,22 @@ > commandId="org.eclipse.jubula.client.ui.commands.OpenSpecification"> > <activeWhen> > <and> >+ <not> >+ <instanceof value="org.eclipse.jubula.client.core.model.IRefTestSuitePO" /> >+ </not> > <with variable="org.eclipse.jubula.client.ui.rcp.variable.isProjectActive"> > <equals value="true" /> > </with> > <count value="1" /> >- <iterate operator="and"> >+ <iterate operator="or" ifEmpty="false"> > <or> >- <instanceof value="org.eclipse.jubula.client.core.model.IExecTestCasePO" /> >- <instanceof value="org.eclipse.jubula.client.core.model.IEventExecTestCasePO" /> > <instanceof value="org.eclipse.jubula.client.core.model.TestResultNode" /> >+ <and> >+ <instanceof value="org.eclipse.jubula.client.core.model.INodePO" /> >+ <test >+ property="org.eclipse.jubula.client.ui.rcp.Selection.isNotRootInEditor"> >+ </test> >+ </and> > </or> > </iterate> > </and> >diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenSpecificationHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenSpecificationHandler.java >index f235670..b15eb17 100644 >--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenSpecificationHandler.java >+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenSpecificationHandler.java >@@ -14,6 +14,8 @@ import org.eclipse.core.commands.ExecutionEvent; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jubula.client.core.model.ISpecTestCasePO; >+import org.eclipse.jubula.client.core.model.ITestJobPO; >+import org.eclipse.jubula.client.core.model.ITestSuitePO; > import org.eclipse.jubula.client.ui.rcp.businessprocess.UINodeBP; > import org.eclipse.ui.handlers.HandlerUtil; > >@@ -29,7 +31,18 @@ public class OpenSpecificationHandler extends AbstractOpenHandler { > if (!(sel instanceof IStructuredSelection)) { > return null; > } >- openSpecNode((IStructuredSelection)sel); >+ IStructuredSelection structuredSel = (IStructuredSelection)sel; >+ if (structuredSel.getFirstElement() instanceof ITestSuitePO) { >+ ITestSuitePO testSuite = (ITestSuitePO) structuredSel >+ .getFirstElement(); >+ openEditor(testSuite); >+ } else if (structuredSel.getFirstElement() instanceof ITestJobPO) { >+ ITestJobPO testJob = (ITestJobPO) structuredSel >+ .getFirstElement(); >+ openEditor(testJob); >+ } else { >+ openSpecNode((IStructuredSelection)sel); >+ } > return null; > } > >@@ -41,7 +54,12 @@ public class OpenSpecificationHandler extends AbstractOpenHandler { > * the current selection > */ > private void openSpecNode(IStructuredSelection structuredSel) { >- ISpecTestCasePO specTc = UINodeBP.getSpecTC(structuredSel); >+ ISpecTestCasePO specTc; >+ if (structuredSel.getFirstElement() instanceof ISpecTestCasePO) { >+ specTc = (ISpecTestCasePO) structuredSel.getFirstElement(); >+ } else { >+ specTc = UINodeBP.getSpecTC(structuredSel); >+ } > openEditorForSpecTC(specTc); > } > } >\ No newline at end of file >diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/SelectionPropertyTester.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/SelectionPropertyTester.java >new file mode 100644 >index 0000000..0868c79 >--- /dev/null >+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/SelectionPropertyTester.java >@@ -0,0 +1,75 @@ >+/******************************************************************************* >+ * Copyright (c) 2013 BREDEX GmbH. >+ * 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: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.client.ui.rcp.propertytester; >+ >+import org.eclipse.jubula.client.core.model.IEventExecTestCasePO; >+import org.eclipse.jubula.client.core.model.IExecTestCasePO; >+import org.eclipse.jubula.client.core.model.INodePO; >+import org.eclipse.jubula.client.core.model.IProjectPO; >+import org.eclipse.jubula.client.core.model.ISpecTestCasePO; >+import org.eclipse.jubula.client.core.model.ITestJobPO; >+import org.eclipse.jubula.client.core.model.ITestSuitePO; >+import org.eclipse.jubula.client.core.propertytester.AbstractBooleanPropertyTester; >+ >+ >+/** >+ * Property tester for Selections. >+ * >+ * @author BREDEX GmbH >+ * @created Sep 27, 2013 >+ */ >+public class SelectionPropertyTester extends AbstractBooleanPropertyTester { >+ /** the id of the "isRoot" property */ >+ public static final String IS_NOT_ROOT_IN_EDITOR = "isNotRootInEditor"; //$NON-NLS-1$ >+ /** >+ * <code>PROPERTIES</code> >+ */ >+ private static final String[] PROPERTIES = >+ new String[] { IS_NOT_ROOT_IN_EDITOR }; >+ >+ /** {@inheritDoc} */ >+ public boolean testImpl(Object receiver, String property, Object[] args) { >+ INodePO node = (INodePO)receiver; >+ if (property.equals(IS_NOT_ROOT_IN_EDITOR)) { >+ if (node instanceof IExecTestCasePO >+ || node instanceof IEventExecTestCasePO) { >+ // an ExecTestCase or an EventExecTestCase is never a root >+ return true; >+ } else if (node instanceof ISpecTestCasePO) { >+ ISpecTestCasePO specTc = (ISpecTestCasePO) node; >+ if (!(specTc.getParentNode() instanceof IProjectPO)) { >+ return true; >+ } >+ } else if (node instanceof ITestSuitePO) { >+ ITestSuitePO testSuite = (ITestSuitePO) node; >+ if (!(testSuite.getParentNode() == null)) { >+ return true; >+ } >+ } else if (node instanceof ITestJobPO) { >+ ITestJobPO testJob = (ITestJobPO) node; >+ if (!(testJob.getParentNode() == null)) { >+ return true; >+ } >+ } >+ } >+ return false; >+ } >+ >+ /** {@inheritDoc} */ >+ public Class<? extends Object> getType() { >+ return INodePO.class; >+ } >+ >+ /** {@inheritDoc} */ >+ public String[] getProperties() { >+ return PROPERTIES; >+ } >+} >-- >1.7.11 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 418298
:
235946
|
235976
|
237166