java - swt table has limitation on text length in a cell? -
java - swt table has limitation on text length in a cell? -
i utilize jface tableviewer , databinding display info of database table, columns have long text, found text cutting out. if activate text editor associated cell, can see total text.
does swt table has limitation on text length in cell ? or os has such limitation ?(i using eclipse 3.6 , windows 7 32 bit)
/******************************************************************************* * copyright (c) 2006 tom schindl , others. * rights reserved. programme , accompanying materials * made available under terms of eclipse public license v1.0 * accompanies distribution, , available @ * http://www.eclipse.org/legal/epl-v10.html * * contributors: * tom schindl - initial api , implementation *******************************************************************************/ bundle org.eclipse.jface.snippets.viewers; import org.eclipse.jface.viewers.istructuredcontentprovider; import org.eclipse.jface.viewers.labelprovider; import org.eclipse.jface.viewers.tableviewer; import org.eclipse.jface.viewers.viewer; import org.eclipse.swt.layout.filllayout; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.shell; /** * simple tableviewer demonstrate usage * * @author tom schindl <tom.schindl@bestsolution.at> * */ public class snippet001tableviewer { private class mycontentprovider implements istructuredcontentprovider { /* (non-javadoc) * @see org.eclipse.jface.viewers.istructuredcontentprovider#getelements(java.lang.object) */ public object[] getelements(object inputelement) { homecoming (mymodel[])inputelement; } /* (non-javadoc) * @see org.eclipse.jface.viewers.icontentprovider#dispose() */ public void dispose() { } /* (non-javadoc) * @see org.eclipse.jface.viewers.icontentprovider#inputchanged(org.eclipse.jface.viewers.viewer, java.lang.object, java.lang.object) */ public void inputchanged(viewer viewer, object oldinput, object newinput) { } } public class mymodel { public int counter; public mymodel(int counter) { this.counter = counter; } public string tostring() { **return "very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooog text" + this.counter;** } } public snippet001tableviewer(shell shell) { final tableviewer v = new tableviewer(shell); v.setlabelprovider(new labelprovider()); v.setcontentprovider(new mycontentprovider()); mymodel[] model = createmodel(); v.setinput(model); v.gettable().setlinesvisible(true); } private mymodel[] createmodel() { mymodel[] elements = new mymodel[10]; for( int = 0; < 10; i++ ) { elements[i] = new mymodel(i); } homecoming elements; } /** * @param args */ public static void main(string[] args) { display display = new display (); shell shell = new shell(display); shell.setlayout(new filllayout()); new snippet001tableviewer(shell); shell.open (); while (!shell.isdisposed ()) { if (!display.readanddispatch ()) display.sleep (); } display.dispose (); } }
it's windows bug/feature (see bugzilla details), here proof (linux screenshot of code)
i may possible workaround bug/feature self cell rendering (see custom drawing table , tree items tutorial).
java swt jface
Comments
Post a Comment