Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] New to mailing list and a small problem

Hi all,

I am new this list, my name is Ian Michell and I am an Analyst Programmer.

I have a small problem with swt.widgets.Combo, whenever I do a setTextLimit on it, the widget just ignores me. Included of couse is the code I am using:

// Create Label for Surface Finish
Label l_surf = new Label(c, SWT.LEFT);
l_surf.setText("Surface Finish:");
// Create Combo Box and grid data
GridData gd_surf = new GridData();
gd_surf.horizontalAlignment = GridData.FILL;
gd_surf.grabExcessHorizontalSpace = true;
m_s_surf = new Combo(c, SWT.DROP_DOWN | SWT.READ_ONLY);
m_s_surf.setTextLimit(15);
m_s_surf.setLayoutData(gd_surf);
// Populate Field
this.populate_field(m_s_surf, "asb_treatment", "description");

And Below is the function populate field.

// This function will populate a given field with // the correct values
private void populate_field(Combo c, String table, String column)
{
       DataBuffer b = new DataBuffer();
       System.out.println("Before: " + c.getTextLimit());
       while (b.next())
       {
           DataBuffer buf = b.get_row();
           if (buf.d_tablename.equalsIgnoreCase(table)) {
               c.add(buf.get_string(column).trim());
           }
       }
}

Is anyone able to help me?

Rgds

Ian


Back to the top