use of com.archimatetool.editor.propertysections.PropertySectionTextControl in project archi by archimatetool.
the class HintContentSection method createControls.
@Override
protected void createControls(Composite parent) {
createLabel(parent, Messages.HintContentSection_0, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
Text text = createSingleTextControl(parent, SWT.NONE);
text.setMessage(Messages.HintContentSection_2);
fTextTitleControl = new PropertySectionTextControl(text, ICanvasPackage.Literals.HINT_PROVIDER__HINT_TITLE) {
@Override
protected void textChanged(String oldText, String newText) {
CompoundCommand result = new CompoundCommand();
for (EObject provider : getEObjects()) {
if (isAlive(provider)) {
Command cmd = new EObjectFeatureCommand(Messages.HintContentSection_1, provider, ICanvasPackage.Literals.HINT_PROVIDER__HINT_TITLE, newText);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
};
createLabel(parent, Messages.HintContentSection_3, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.NONE);
StyledTextControl styledTextControl = createStyledTextControl(parent, SWT.NONE);
styledTextControl.setMessage(Messages.HintContentSection_5);
fTextContentControl = new PropertySectionTextControl(styledTextControl.getControl(), ICanvasPackage.Literals.HINT_PROVIDER__HINT_CONTENT) {
@Override
protected void textChanged(String oldText, String newText) {
CompoundCommand result = new CompoundCommand();
for (EObject provider : getEObjects()) {
if (isAlive(provider)) {
Command cmd = new EObjectFeatureCommand(Messages.HintContentSection_4, provider, ICanvasPackage.Literals.HINT_PROVIDER__HINT_CONTENT, newText);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
};
// Help
PlatformUI.getWorkbench().getHelpSystem().setHelp(fTextContentControl.getTextControl(), HELP_ID);
}
use of com.archimatetool.editor.propertysections.PropertySectionTextControl in project archi by archimatetool.
the class NotesSection method createControls.
@Override
protected void createControls(Composite parent) {
createLabel(parent, Messages.NotesSection_0, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.NONE);
StyledTextControl styledTextControl = createStyledTextControl(parent, SWT.NONE);
styledTextControl.setMessage(Messages.NotesSection_2);
fTextNotesControl = new PropertySectionTextControl(styledTextControl.getControl(), ICanvasPackage.Literals.NOTES_CONTENT__NOTES) {
@Override
protected void textChanged(String oldText, String newText) {
CompoundCommand result = new CompoundCommand();
for (EObject notesContent : getEObjects()) {
if (isAlive(notesContent)) {
Command cmd = new EObjectFeatureCommand(Messages.NotesSection_1, notesContent, ICanvasPackage.Literals.NOTES_CONTENT__NOTES, newText);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
};
// Help
PlatformUI.getWorkbench().getHelpSystem().setHelp(fTextNotesControl.getTextControl(), HELP_ID);
}
Aggregations