use of org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea in project egit by eclipse.
the class CommitEditorPage method createMessageArea.
private void createMessageArea(Composite parent, FormToolkit toolkit, int span) {
Section messageSection = createSection(parent, toolkit, UIText.CommitEditorPage_SectionMessage, span, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
Composite messageArea = createSectionClient(messageSection, toolkit);
RevCommit commit = getCommit().getRevCommit();
String message = commit.getFullMessage();
SpellcheckableMessageArea textContent = new SpellcheckableMessageArea(messageArea, message, true, toolkit.getBorderStyle()) {
@Override
protected IAdaptable getDefaultTarget() {
return new PlatformObject() {
@Override
public Object getAdapter(Class adapter) {
return Platform.getAdapterManager().getAdapter(getEditorInput(), adapter);
}
};
}
@Override
protected void createMarginPainter() {
// Disabled intentionally
}
};
if ((toolkit.getBorderStyle() & SWT.BORDER) == 0)
textContent.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
StyledText textWidget = textContent.getTextWidget();
Point size = textWidget.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int yHint = size.y > 80 ? 80 : SWT.DEFAULT;
GridDataFactory.fillDefaults().hint(SWT.DEFAULT, yHint).minSize(1, 20).grab(true, true).applyTo(textContent);
addToFocusTracking(textWidget);
updateSectionClient(messageSection, messageArea, toolkit);
}
use of org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea in project egit by eclipse.
the class CommitMessageEditorDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
final Composite composite = (Composite) super.createDialogArea(parent);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
composite.setLayout(gridLayout);
setTitle(UIText.RebaseInteractiveHandler_EditMessageDialogTitle);
setMessage(UIText.RebaseInteractiveHandler_EditMessageDialogText);
messageArea = new SpellcheckableMessageArea(composite, commitMessage);
messageArea.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
Point size = messageArea.getTextWidget().getSize();
int minHeight = messageArea.getTextWidget().getLineHeight() * 3;
messageArea.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(size).minSize(size.x, minHeight).align(SWT.FILL, SWT.FILL).create());
messageArea.setFocus();
return composite;
}
Aggregations