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 73585 Details for
Bug 192259
[Schema][Editors] Add "Remove", "New Choice", "New Sequence" buttons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fixed fixed patch
patch192259.txt (text/plain), 6.18 KB, created by
Adam Archer
on 2007-07-11 15:16:36 EDT
(
hide
)
Description:
fixed fixed patch
Filename:
MIME Type:
Creator:
Adam Archer
Created:
2007-07-11 15:16:36 EDT
Size:
6.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.294 >diff -u -r1.294 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 10 Jul 2007 19:45:44 -0000 1.294 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 11 Jul 2007 19:16:24 -0000 >@@ -325,6 +325,12 @@ > > public static String RequiresSection_sortAlpha; > >+ public static String SchemaEditor_ElementSection_newChoice; >+ >+ public static String SchemaEditor_ElementSection_newSequence; >+ >+ public static String SchemaEditor_ElementSection_remove; >+ > public static String SchemaPreviewLauncher_msgEditorHasUnsavedChanges; > > public static String SchemaPreviewLauncher_msgSaveChanges; >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.884 >diff -u -r1.884 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 10 Jul 2007 19:45:44 -0000 1.884 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 11 Jul 2007 19:16:24 -0000 >@@ -374,9 +374,12 @@ > SchemaEditor_SpecSection_name = Point Name: > > SchemaEditor_ElementSection_title = Extension Point Elements >+SchemaEditor_ElementSection_remove=Remove > SchemaEditor_ElementSection_desc = Specify the XML elements and attributes which are allowed in this extension point. > SchemaEditor_ElementSection_newElement = New Element >+SchemaEditor_ElementSection_newChoice=New Choice > SchemaEditor_ElementSection_newAttribute = New Attribute >+SchemaEditor_ElementSection_newSequence=New Sequence > SchemaAttributeDetails_defaultDefaultValue=(ENTER DEFAULT) > > ReviewPage_noSampleFound=No sample has been selected. >Index: src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java,v >retrieving revision 1.47 >diff -u -r1.47 ElementSection.java >--- src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java 10 Jul 2007 17:00:48 -0000 1.47 >+++ src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java 11 Jul 2007 19:16:24 -0000 >@@ -119,7 +119,10 @@ > public ElementSection(PDEFormPage page, Composite parent) { > super(page, parent, Section.DESCRIPTION, new String[] { > PDEUIMessages.SchemaEditor_ElementSection_newElement, >- PDEUIMessages.SchemaEditor_ElementSection_newAttribute }); >+ PDEUIMessages.SchemaEditor_ElementSection_newAttribute, >+ PDEUIMessages.SchemaEditor_ElementSection_newChoice, >+ PDEUIMessages.SchemaEditor_ElementSection_newSequence, >+ PDEUIMessages.SchemaEditor_ElementSection_remove}); > getSection().setText(PDEUIMessages.SchemaEditor_ElementSection_title); > getSection().setDescription(PDEUIMessages.SchemaEditor_ElementSection_desc); > } >@@ -202,8 +205,30 @@ > case 1: > handleNewAttribute(); > break; >+ case 2: >+ addCompositor(ISchemaCompositor.CHOICE); >+ break; >+ case 3: >+ addCompositor(ISchemaCompositor.SEQUENCE); >+ break; >+ case 4: >+ final ISelection selection = fTreeViewer.getSelection(); >+ handleDelete((IStructuredSelection)selection); >+ break; > } > } >+ >+ private void addCompositor (int kind) { >+ Object selection = ((IStructuredSelection)fTreeViewer.getSelection()).getFirstElement(); >+ ISchemaElement sourceElement = null; >+ Object current = selection; >+ while (current instanceof ISchemaCompositor) >+ current = ((ISchemaCompositor)current).getParent(); >+ if (current instanceof ISchemaElement) >+ sourceElement = (ISchemaElement) current; >+ if (sourceElement != null) >+ new NewCompositorAction(sourceElement, selection, kind).run(); >+ } > > public void dispose() { > if (fClipboard != null) { >@@ -531,22 +556,37 @@ > private void updateButtons() { > if (!fSchema.isEditable()) > return; >- Object object = ((IStructuredSelection) fTreeViewer.getSelection()).getFirstElement(); >- ISchemaObject sobject = (ISchemaObject) object; >+ IStructuredSelection selection = (IStructuredSelection) fTreeViewer.getSelection(); >+ ISchemaObject sobject = (ISchemaObject) selection.getFirstElement(); > > boolean canAddAttribute = false; >- if (sobject != null) { >- if (sobject instanceof ISchemaElement) { >- if (!(sobject instanceof ISchemaRootElement) >- && !(sobject instanceof ISchemaObjectReference)) >- canAddAttribute = true; >- } else if (sobject instanceof ISchemaAttribute) { >- ISchemaElement element = (ISchemaElement) (sobject.getParent()); >- if (!(element instanceof ISchemaRootElement)) >- canAddAttribute = true; >- } >+ if (sobject instanceof ISchemaElement) { >+ if (!(sobject instanceof ISchemaRootElement) >+ && !(sobject instanceof ISchemaObjectReference)) >+ canAddAttribute = true; >+ } else if (sobject instanceof ISchemaAttribute) { >+ ISchemaElement element = (ISchemaElement) (sobject.getParent()); >+ if (!(element instanceof ISchemaRootElement)) >+ canAddAttribute = true; > } > getTreePart().setButtonEnabled(1, canAddAttribute); >+ >+ boolean canAddCompositor = false; >+ if (sobject instanceof ISchemaCompositor || (sobject instanceof ISchemaElement && !(sobject instanceof SchemaElementReference))) >+ canAddCompositor = true; >+ getTreePart().setButtonEnabled(2, canAddCompositor); >+ getTreePart().setButtonEnabled(3, canAddCompositor); >+ >+ boolean canRemove = false; >+ for (Iterator iter = selection.iterator(); iter.hasNext();) { >+ sobject = (ISchemaObject) iter.next(); >+ if (sobject != null && !(sobject instanceof ISchemaRootElement) && >+ !(sobject instanceof ISchemaAttribute && sobject.getParent() instanceof ISchemaRootElement)) { >+ canRemove = true; >+ break; >+ } >+ } >+ getTreePart().setButtonEnabled(4, canRemove); > } > > private ISchemaObject getSibling(Object target, Object object) {
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
Flags:
mike.pawlowski
:
review+
Actions:
View
|
Diff
Attachments on
bug 192259
:
73556
|
73577
| 73585