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 58807 Details for
Bug 173302
[PropertiesDialog] allow Project References property page to be disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
IEnablementVetoHolder property tester
EnablementVetoHolder_Feb12_1.txt (text/plain), 5.63 KB, created by
Andrew Ferguson
on 2007-02-12 17:58:37 EST
(
hide
)
Description:
IEnablementVetoHolder property tester
Filename:
MIME Type:
Creator:
Andrew Ferguson
Created:
2007-02-12 17:58:37 EST
Size:
5.63 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/plugin.xml,v >retrieving revision 1.167 >diff -u -r1.167 plugin.xml >--- plugin.xml 5 Feb 2007 02:10:31 -0000 1.167 >+++ plugin.xml 12 Feb 2007 22:40:26 -0000 >@@ -536,7 +536,15 @@ > name="%PropertyPages.project.reference" > > > <enabledWhen> >- <adapt type="org.eclipse.core.resources.IProject"/> >+ <and> >+ <test >+ args="org.eclipse.ui.propertypages.project.reference" >+ property="org.eclipse.core.expressions.notVetoed"> >+ </test> >+ <adapt >+ type="org.eclipse.core.resources.IProject"> >+ </adapt> >+ </and> > </enabledWhen> > </page> > <page >#P org.eclipse.core.expressions >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.expressions/plugin.xml,v >retrieving revision 1.10 >diff -u -r1.10 plugin.xml >--- plugin.xml 15 Jan 2007 09:37:17 -0000 1.10 >+++ plugin.xml 12 Feb 2007 22:40:35 -0000 >@@ -13,6 +13,13 @@ > properties="product,isBundleInstalled" > class="org.eclipse.core.internal.expressions.propertytester.PlatformPropertyTester"> > </propertyTester> >+ <propertyTester >+ class="org.eclipse.core.internal.expressions.EnablementVetoHolderPropertyTester" >+ id="org.eclipse.core.expressions.EnablementVetoHolderPropertyTester" >+ namespace="org.eclipse.core.expressions" >+ properties="notVetoed" >+ type="java.lang.Object"> >+ </propertyTester> > </extension> > > </plugin> >Index: src/org/eclipse/core/expressions/IEnablementVetoHolder.java >=================================================================== >RCS file: src/org/eclipse/core/expressions/IEnablementVetoHolder.java >diff -N src/org/eclipse/core/expressions/IEnablementVetoHolder.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/expressions/IEnablementVetoHolder.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,31 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Symbian Software Systems 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: >+ * Andrew Ferguson (Symbian) - Initial implementation >+ *******************************************************************************/ >+package org.eclipse.core.expressions; >+ >+/** >+ * The org.eclipse.core.expressions.notVetoed test expression allows >+ * the object being tested to register an Adapter for this interface type. >+ * >+ * If the object being tested can be adapted to this interface type it will >+ * be given the chance to veto the subexpression it appears in. >+ * >+ * @since 3.3 >+ */ >+public interface IEnablementVetoHolder { >+ /** >+ * Returns whether this veto holder chooses to veto the subexpression >+ * it appears in. >+ * @param id the id provided in the test expression >+ * @return whether this veto holder chooses to veto the subexpression >+ * it appears in. >+ */ >+ boolean vetoes(String id); >+} >Index: src/org/eclipse/core/internal/expressions/EnablementVetoHolderPropertyTester.java >=================================================================== >RCS file: src/org/eclipse/core/internal/expressions/EnablementVetoHolderPropertyTester.java >diff -N src/org/eclipse/core/internal/expressions/EnablementVetoHolderPropertyTester.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/internal/expressions/EnablementVetoHolderPropertyTester.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,48 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Symbian Software Systems 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: >+ * Andrew Ferguson (Symbian) - Initial implementation >+ *******************************************************************************/ >+package org.eclipse.core.internal.expressions; >+ >+import org.eclipse.core.runtime.Platform; >+ >+import org.eclipse.core.expressions.IEnablementVetoHolder; >+import org.eclipse.core.expressions.PropertyTester; >+ >+/** >+ * Tests whether the object under test >+ * <ul> >+ * <li> can be Adapted to an IEnablementVetoHolder >+ * <li> does not veto any of the property IDs passed to it >+ * </ul> >+ * >+ * @since 3.3 >+ */ >+public class EnablementVetoHolderPropertyTester extends PropertyTester { >+ public EnablementVetoHolderPropertyTester() {} >+ >+ public boolean test(Object receiver, >+ String property, >+ Object[] args, >+ Object expectedValue) { >+ if(property.equals("notVetoed")) { //$NON-NLS-1$ >+ IEnablementVetoHolder evh; >+ evh= (IEnablementVetoHolder) Platform.getAdapterManager().getAdapter(receiver, IEnablementVetoHolder.class); >+ if(evh!=null) { >+ for(int i=0; i<args.length; i++) { >+ String vetoCandidateID = (String) args[i]; >+ if(evh.vetoes(vetoCandidateID)) { >+ return false; >+ } >+ } >+ } >+ } >+ return true; >+ } >+}
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 173302
:
58457
| 58807 |
58808
|
58810