Methods Summary |
---|
public void | createUiControl(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.IManagedForm managedForm)
setManagedForm(managedForm);
TextAttributeDescriptor desc = (TextAttributeDescriptor) getDescriptor();
Text text = SectionHelper.createLabelAndText(parent, managedForm.getToolkit(),
desc.getUiName(), getCurrentValue(),
DescriptorsUtils.formatTooltip(desc.getTooltip()));
setTextWidget(text);
|
protected org.eclipse.ui.forms.IManagedForm | getManagedForm()
return mManagedForm;
|
public java.lang.String[] | getPossibleValues(java.lang.String prefix)No completion values for this UI attribute.
{@inheritDoc}
return null;
|
protected final org.eclipse.swt.widgets.Text | getTextWidget()Returns the text widget.
return mText;
|
public java.lang.String | getTextWidgetValue()
if (mText != null) {
return mText.getText();
}
return null;
|
public boolean | isValid()
return mText != null;
|
protected void | onAddValidators(org.eclipse.swt.widgets.Text text)Called after the text widget as been created.
Derived classes typically want to:
Create a new {@link ModifyListener} and attach it to the given {@link Text} widget.
In the modify listener, call getManagedForm().getMessageManager().addMessage()
and getManagedForm().getMessageManager().removeMessage() as necessary.
Call removeMessage in a new text.addDisposeListener.
Call the validator once to setup the initial messages as needed.
The base implementation does nothing.
|
protected void | setManagedForm(org.eclipse.ui.forms.IManagedForm managedForm)Sets the internal managed form.
This is usually set by createUiControl.
mManagedForm = managedForm;
|
protected final void | setTextWidget(org.eclipse.swt.widgets.Text textWidget)Sets the Text widget object, and prepares it to handle modification and synchronization
with the XML node.
mText = textWidget;
if (textWidget != null) {
// Sets the with hint for the text field. Derived classes can always override it.
// This helps the grid layout to resize correctly on smaller screen sizes.
Object data = textWidget.getLayoutData();
if (data == null) {
} else if (data instanceof GridData) {
((GridData)data).widthHint = AndroidEditor.TEXT_WIDTH_HINT;
} else if (data instanceof TableWrapData) {
((TableWrapData)data).maxWidth = 100;
}
mText.addModifyListener(new ModifyListener() {
/**
* Sent when the text is modified, whether by the user via manual
* input or programmatic input via setText().
* <p/>
* Simply mark the attribute as dirty if it really changed.
* The container SectionPart will collect these flag and manage them.
*/
public void modifyText(ModifyEvent e) {
if (!isInInternalTextModification() &&
!isDirty() &&
mText != null &&
getCurrentValue() != null &&
!mText.getText().equals(getCurrentValue())) {
setDirty(true);
}
}
});
// Remove self-reference when the widget is disposed
mText.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
mText = null;
}
});
}
onAddValidators(mText);
|
public void | setTextWidgetValue(java.lang.String value)
if (mText != null) {
mText.setText(value);
}
|