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 74204 Details for
Bug 197056
[Schema][Editors] Move attribute "use" field "deprecated" field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
set uniform size for all detail pages
patch197056b.txt (text/plain), 13.52 KB, created by
Adam Archer
on 2007-07-19 20:57:28 EDT
(
hide
)
Description:
set uniform size for all detail pages
Filename:
MIME Type:
Creator:
Adam Archer
Created:
2007-07-19 20:57:28 EDT
Size:
13.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java,v >retrieving revision 1.33 >diff -u -r1.33 SchemaAttributeDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java 19 Jul 2007 20:29:27 -0000 1.33 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java 20 Jul 2007 00:48:46 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > *******************************************************************************/ > package org.eclipse.pde.internal.ui.editor.schema; >+import org.eclipse.jface.layout.GridLayoutFactory; > import org.eclipse.osgi.util.NLS; > import org.eclipse.pde.core.IModelChangedEvent; > import org.eclipse.pde.internal.core.ischema.IMetaAttribute; >@@ -28,6 +29,7 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Label; >@@ -79,6 +81,8 @@ > Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); > > fName = new FormEntry(parent, toolkit, PDEUIMessages.SchemaDetails_name, SWT.NONE); >+ // Ensures label columns on every detail page are same width >+ ((GridData)fName.getLabel().getLayoutData()).widthHint = minLabelWeight; > > Label label = toolkit.createLabel(parent, PDEUIMessages.SchemaDetails_deprecated); > label.setForeground(foreground); >@@ -86,17 +90,24 @@ > fDepTrue = buttons[0]; > fDepFalse = buttons[1]; > >- label = toolkit.createLabel(parent, PDEUIMessages.SchemaAttributeDetails_type); >+ label = toolkit.createLabel(parent, PDEUIMessages.SchemaAttributeDetails_use); > label.setForeground(foreground); >- fType = createComboPart(parent, toolkit, TYPES, 2); > >- createTypeDetails(parent, toolkit); >+ Composite useComp = toolkit.createComposite(parent); >+ GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.horizontalSpan = 2; >+ useComp.setLayoutData(gd); >+ useComp.setLayout(GridLayoutFactory.fillDefaults().margins(0,0).numColumns(2).create()); > >- label = toolkit.createLabel(parent, PDEUIMessages.SchemaAttributeDetails_use); >+ fUse = createComboPart(useComp, toolkit, USE, 1, SWT.NONE); >+ >+ fValue = new FormEntry(useComp, toolkit, null, 0, 1); >+ >+ label = toolkit.createLabel(parent, PDEUIMessages.SchemaAttributeDetails_type); > label.setForeground(foreground); >- fUse = createComboPart(parent, toolkit, USE, 2); >+ fType = createComboPart(parent, toolkit, TYPES, 2); > >- fValue = new FormEntry(parent, toolkit, PDEUIMessages.SchemaAttributeDetails_defaultValue, null, false, 6); >+ createTypeDetails(parent, toolkit); > > toolkit.paintBordersFor(parent); > setText(PDEUIMessages.SchemaAttributeDetails_title); >@@ -119,14 +130,15 @@ > > fUse.select(fAttribute.getUse()); > Object value = fAttribute.getValue(); >- fValue.setValue(value != null ? value.toString() : "", true); //$NON-NLS-1$ >+ fValue.setValue(value != null ? value.toString() : PDEUIMessages.SchemaAttributeDetails_defaultDefaultValue, true); > > boolean editable = isEditableElement(); > if (fAttribute.getUse() != 2) { >- fValue.getLabel().setEnabled(false); > fValue.getText().setEditable(false); >+ fValue.getText().setEnabled(false); > } else { > fValue.setEditable(editable); >+ fValue.getText().setEnabled(true); > } > fName.setEditable(editable); > fDepTrue.setEnabled(editable); >@@ -206,14 +218,13 @@ > return; > int use = fUse.getSelectionIndex(); > fAttribute.setUse(use); >- fValue.getLabel().setEnabled(use == 2); >- fValue.getText().setEditable(use == 2); >- if (use == 2 && fValue.getValue().length() == 0) { >- fValue.setValue(PDEUIMessages.SchemaAttributeDetails_defaultDefaultValue); >+ fValue.setEditable(use == 2); >+ fValue.getText().setEnabled(use == 2); >+ if (use == 2 && fValue.getValue().equals(PDEUIMessages.SchemaAttributeDetails_defaultDefaultValue)) { > fValue.getText().setSelection(0, fValue.getValue().length()); > fValue.getText().setFocus(); > } else if (use != 2) >- fValue.setValue(""); //$NON-NLS-1$ >+ fValue.setValue(PDEUIMessages.SchemaAttributeDetails_defaultDefaultValue); > > } > }); >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java,v >retrieving revision 1.25 >diff -u -r1.25 SchemaElementDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java 19 Jul 2007 20:29:27 -0000 1.25 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java 20 Jul 2007 00:48:47 -0000 >@@ -31,6 +31,7 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Label; >@@ -57,7 +58,9 @@ > Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); > > fName = new FormEntry(parent, toolkit, PDEUIMessages.SchemaDetails_name, SWT.NONE); >- >+ // Ensures label columns on every detail page are same width >+ ((GridData)fName.getLabel().getLayoutData()).widthHint = minLabelWeight; >+ > Label label = toolkit.createLabel(parent, PDEUIMessages.SchemaDetails_deprecated); > label.setForeground(foreground); > Button[] buttons = createTrueFalseButtons(parent, toolkit, 2); >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java,v >retrieving revision 1.20 >diff -u -r1.20 SchemaRootElementDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java 18 Jul 2007 23:17:14 -0000 1.20 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java 20 Jul 2007 00:48:47 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Label; >@@ -45,6 +46,8 @@ > Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); > > fName = new FormEntry(parent, toolkit, PDEUIMessages.SchemaDetails_name, SWT.READ_ONLY); >+ // Ensures label columns on every detail page are same width >+ ((GridData)fName.getLabel().getLayoutData()).widthHint = minLabelWeight; > > Label label = toolkit.createLabel(parent, PDEUIMessages.SchemaDetails_deprecated); > label.setForeground(foreground); >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java,v >retrieving revision 1.12 >diff -u -r1.12 SchemaCompositorDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java 18 Jul 2007 23:17:14 -0000 1.12 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java 20 Jul 2007 00:48:46 -0000 >@@ -41,10 +41,14 @@ > createMaxOccurComp(parent, toolkit); > > fKindLabel = toolkit.createLabel(parent, PDEUIMessages.SchemaCompositorDetails_type); >+ GridData gd = new GridData(); >+ // Ensures label columns on every detail page are same width >+ gd.widthHint = minLabelWeight; >+ fKindLabel.setLayoutData(gd); > fKindLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); > fKind = new ComboPart(); > fKind.createControl(parent, toolkit, SWT.READ_ONLY); >- GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd = new GridData(GridData.FILL_HORIZONTAL); > gd.horizontalSpan = 2; > fKind.getControl().setLayoutData(gd); > fKind.setItems(new String[] { >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java,v >retrieving revision 1.12 >diff -u -r1.12 SchemaElementReferenceDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java 18 Jul 2007 23:17:14 -0000 1.12 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java 20 Jul 2007 00:48:47 -0000 >@@ -43,9 +43,13 @@ > createMaxOccurComp(parent, toolkit); > > fRefLabel = toolkit.createLabel(parent, PDEUIMessages.SchemaElementReferenceDetails_reference); >+ GridData gd = new GridData(); >+ // Ensures label columns on every detail page are same width >+ gd.widthHint = minLabelWeight; >+ fRefLabel.setLayoutData(gd); > fRefLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); > fReferenceLink = toolkit.createHyperlink(parent, new String(), SWT.NONE); >- GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd = new GridData(GridData.FILL_HORIZONTAL); > gd.horizontalSpan = 2; > fReferenceLink.setLayoutData(gd); > >Index: src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java,v >retrieving revision 1.22 >diff -u -r1.22 AbstractSchemaDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java 19 Jul 2007 22:48:58 -0000 1.22 >+++ src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java 20 Jul 2007 00:48:46 -0000 >@@ -30,6 +30,7 @@ > import org.eclipse.swt.events.ModifyListener; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.graphics.GC; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; >@@ -49,6 +50,8 @@ > protected static final String[] BOOLS = > new String[] { Boolean.toString(true), Boolean.toString(false) }; > >+ protected int minLabelWeight; >+ > private Section fSection; > private SchemaDtdDetailsSection fDtdSection = null; > private ElementSection fElementSection; >@@ -83,7 +86,15 @@ > } > > public final void createContents(Composite parent) { >- >+ // This is a hacked fix to ensure that the label columns on every details >+ // page have the same width. AbstractSchemaDetails_maxOccurLabel >+ // represents the longest label on any field on any details page. This >+ // occurs on SchemaCompositeDetails and SchemaElementReferenceDetails. >+ GC gc = new GC(parent); >+ minLabelWeight = gc.textExtent(PDEUIMessages.AbstractSchemaDetails_maxOccurLabel).x; >+ gc.dispose(); >+ gc = null; >+ > parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1)); > FormToolkit toolkit = getManagedForm().getToolkit(); > fSection = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR); >@@ -244,10 +255,10 @@ > fElementSection.fireSelection(selection); > } > >- protected ComboPart createComboPart(Composite parent, FormToolkit toolkit, String[] items, int colspan) { >+ protected ComboPart createComboPart(Composite parent, FormToolkit toolkit, String[] items, int colspan, int style) { > ComboPart cp = new ComboPart(); > cp.createControl(parent, toolkit, SWT.READ_ONLY); >- GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ GridData gd = new GridData(style); > gd.horizontalSpan = colspan; > gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT; > cp.getControl().setLayoutData(gd); >@@ -256,6 +267,10 @@ > return cp; > } > >+ protected ComboPart createComboPart(Composite parent, FormToolkit toolkit, String[] items, int colspan) { >+ return createComboPart(parent, toolkit, items, colspan, GridData.FILL_HORIZONTAL); >+ } >+ > protected Button[] createTrueFalseButtons(Composite parent, FormToolkit toolkit, int colSpan) { > Composite comp = toolkit.createComposite(parent, SWT.NONE); > GridLayout gl = new GridLayout(2, false); >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.892 >diff -u -r1.892 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 19 Jul 2007 15:58:29 -0000 1.892 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 20 Jul 2007 00:48:46 -0000 >@@ -377,7 +377,7 @@ > SchemaEditor_ElementSection_newChoice=New Choice > SchemaEditor_ElementSection_newAttribute = New Attribute > SchemaEditor_ElementSection_newSequence=New Sequence >-SchemaAttributeDetails_defaultDefaultValue=(ENTER DEFAULT) >+SchemaAttributeDetails_defaultDefaultValue=(default) > > ReviewPage_noSampleFound=No sample has been selected. >
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 197056
:
74203
|
74204
|
74205
|
74206
|
74207
|
74213
|
74215
|
74216
|
74217
|
74220
|
74315