دنبال کننده ها

۱۳۹۷ فروردین ۲۱, سه‌شنبه

eclipse - Part of Text cut(hidden) in jface ComboBoxCellEditor

[ad_1]




Hi, I have an issue with jface ComboBoxCellEditor that part of the
text is cut like the image below.



[comboBox text cut][1] [1]: https://i.stack.imgur.com/mnyZP.png



I'm using these plugins,



org.eclipse.swt_3.106.1.v20170926-0519.jar
org.eclipse.swt.win32.win32.x86_64_3.106.1.v20170926-0519.jar
org.eclipse.jface_3.13.1.v20170810-0135.jar



This issue only happens on Windows, not on UBUNTU, so it seems to be a
bug of SWT or jface. I filed a bug report against Eclipse SWT
533282, but
haven't got a response yet. If any of you know about this issue and
there's a workaround for this, that will be greatly useful for me.



Thank you!



import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;

class CyTableComboBug extends Dialog

int mComboIndex;
String[] mComboItems = new String[] "Combo Item 1 long string",
"Combo Item 2" ;

public CyTableComboBug(Shell parentShell)

super(parentShell);


@Override
protected Control createDialogArea(final Composite parent)
SWT.V_SCROLL

private class Column1LabelProvider extends ColumnLabelProvider

@Override
public String getText(Object element)

return mComboItems[mComboIndex];



class Column1EditingSupport extends EditingSupport

protected ComboBoxCellEditor mEditor;

public Column1EditingSupport(TableViewer viewer)
SWT.BORDER);

mEditor.setActivationStyle(
ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION);


@Override
protected boolean canEdit(final Object element)

return true;


@Override
protected CellEditor getCellEditor(final Object element)

return mEditor;


@Override
protected Object getValue(final Object element)

return mComboIndex;


@Override
protected void setValue(final Object element, final Object value)

mComboIndex = (int) value;







[ad_2]

لینک منبع