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 128675 Details for
Bug 268497
Provide implementation of AbstractColumnLayout for Grid
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 with the implementation
patch.txt (text/plain), 2.61 KB, created by
Thomas Schindl
on 2009-03-13 04:42:35 EDT
(
hide
)
Description:
Patch with the implementation
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2009-03-13 04:42:35 EDT
Size:
2.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.nebula.widgets.grid >Index: src/org/eclipse/nebula/jface/GridColumnLayout.java >=================================================================== >RCS file: src/org/eclipse/nebula/jface/GridColumnLayout.java >diff -N src/org/eclipse/nebula/jface/GridColumnLayout.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/nebula/jface/GridColumnLayout.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,74 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 BestSolution.at 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: >+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.nebula.jface; >+ >+import org.eclipse.jface.layout.AbstractColumnLayout; >+import org.eclipse.jface.viewers.ColumnLayoutData; >+import org.eclipse.jface.viewers.ColumnPixelData; >+import org.eclipse.nebula.widgets.grid.Grid; >+import org.eclipse.nebula.widgets.grid.GridColumn; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Scrollable; >+import org.eclipse.swt.widgets.Widget; >+ >+/** >+ * A dynamic column layout for nebula grid >+ */ >+public class GridColumnLayout extends AbstractColumnLayout { >+ /** >+ * {@inheritDoc} >+ * >+ * @since 0.9 >+ */ >+ protected int getColumnCount(Scrollable tableTree) { >+ return ((Grid) tableTree).getColumnCount(); >+ } >+ >+ /** >+ * {@inheritDoc} >+ * >+ * @since 0.9 >+ */ >+ protected void setColumnWidths(Scrollable tableTree, int[] widths) { >+ GridColumn[] columns = ((Grid) tableTree).getColumns(); >+ for (int i = 0; i < widths.length; i++) { >+ columns[i].setWidth(widths[i]); >+ } >+ } >+ >+ /** >+ * {@inheritDoc} >+ * >+ * @since 0.9 >+ */ >+ protected ColumnLayoutData getLayoutData(Scrollable tableTree, >+ int columnIndex) { >+ GridColumn column = ((Grid) tableTree).getColumn(columnIndex); >+ return (ColumnLayoutData) column.getData(LAYOUT_DATA); >+ } >+ >+ Composite getComposite(Widget column) { >+ return ((GridColumn) column).getParent().getParent(); >+ } >+ >+ /** >+ * {@inheritDoc} >+ * >+ * @since 0.9 >+ */ >+ protected void updateColumnData(Widget column) { >+ GridColumn tColumn = (GridColumn) column; >+ Grid t = tColumn.getParent(); >+ >+ tColumn.setData(LAYOUT_DATA, new ColumnPixelData(tColumn.getWidth())); >+ layout(t.getParent(), 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 268497
: 128675