/** * Create a file selector widget and related widgets for this class. This class assumes that the * layout manager for the parent Composite object is a GridLayout with 4 columns. * * @param parent * @param id * @param selectorID * @param def */ public FileSelectorRowWidget( Composite parent, String id, Integer selectorID, IAttributeDefinition<?, ?, ?> def) { attr = def; label = new Label(parent, SWT.NONE); // TODO drw label.setText(Messages.getString(attr.getName())); label.setText(attr.getName()); nonDefaultMarker = new Label(parent, SWT.NONE); nonDefaultMarker.setText(" "); // $NON-NLS-1$ gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.grabExcessHorizontalSpace = false; label.setLayoutData(gridData); // TODO drw widget = new FileSelector(parent, selectorID, // Messages.getString(attr.getDescription())); widget = new FileSelector(parent, selectorID, attr.getDescription()); widget.setData(id); try { defaultValue = attr.create().getValueAsString(); } catch (IllegalValueException e) { defaultValue = ""; // $NON-NLS-1$ } eventMonitor = new EventMonitor(); widget.addModifyListener(eventMonitor); }
/** * Set the data value (attribute name) for this object * * @param value The data value */ public void setData(Object value) { widget.setData(value); }