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 18460 Details for
Bug 87141
[TableEdtior] does not paint over cell image
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposal for changed TableEditor
SapTableEditor.java (text/plain), 2.65 KB, created by
Richard Birenheide
on 2005-03-04 09:58:25 EST
(
hide
)
Description:
Proposal for changed TableEditor
Filename:
MIME Type:
Creator:
Richard Birenheide
Created:
2005-03-04 09:58:25 EST
Size:
2.65 KB
patch
obsolete
>/* > * Created on 04.03.2005 > * by Richard Birenheide (D035816) > * > * Copyright SAP AG 2005 > */ >package org.eclipse.swt.custom; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Rectangle; >import org.eclipse.swt.widgets.Table; >import org.eclipse.swt.widgets.TableItem; > >/** > * TODO add type comment > * <p/> > * @author Richard Birenheide (D035816) > */ >public class SapTableEditor extends TableEditor { > private final Table table; > private final boolean[] placeEditorOnImage; > public SapTableEditor(final Table table, final boolean[] placeEditorOnImage) { > super(table); > this.table = table; > if (placeEditorOnImage == null) { > this.placeEditorOnImage = null; > } > else { > this.placeEditorOnImage = (boolean[]) placeEditorOnImage.clone(); > } > } > public SapTableEditor(Table table) { > this(table, null); > } > Rectangle computeBounds () { > if (this.placeEditorOnImage == null) { > return super.computeBounds(); > } > TableItem item = super.getItem(); > int column = super.getColumn(); > if (item == null || column == -1 || item.isDisposed()) return new Rectangle(0, 0, 0, 0); > Rectangle cell = item.getBounds(column); > Rectangle rect = item.getImageBounds(column); > if (this.placeEditorOnImage()) { > cell.x = rect.x; > } > else { > cell.x = rect.x + rect.width; > cell.width -= rect.width; > } > > > Rectangle area = table.getClientArea(); > if (cell.x < area.x + area.width) { > if (cell.x + cell.width > area.x + area.width) { > cell.width = area.x + area.width - cell.x; > } > } > Rectangle editorRect = new Rectangle(cell.x, cell.y, minimumWidth, minimumHeight); > > if (grabHorizontal) { > editorRect.width = Math.max(cell.width, minimumWidth); > } > > if (grabVertical) { > editorRect.height = Math.max(cell.height, minimumHeight); > } > > if (horizontalAlignment == SWT.RIGHT) { > editorRect.x += cell.width - editorRect.width; > } else if (horizontalAlignment == SWT.LEFT) { > // do nothing - cell.x is the right answer > } else { // default is CENTER > editorRect.x += (cell.width - editorRect.width)/2; > } > > if (verticalAlignment == SWT.BOTTOM) { > editorRect.y += cell.height - editorRect.height; > } else if (verticalAlignment == SWT.TOP) { > // do nothing - cell.y is the right answer > } else { // default is CENTER > editorRect.y += (cell.height - editorRect.height)/2; > } > return editorRect; > } > private boolean placeEditorOnImage() { > if (this.placeEditorOnImage == null) { > return false; > } > int column = this.getColumn(); > if (column < 0 || column >= this.placeEditorOnImage.length) { > return false; > } > return this.placeEditorOnImage[column]; > } >}
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 87141
:
18459
| 18460