use of com.archimatetool.editor.ui.components.StyledTextControl 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);
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());
}
};
fTextTitleControl.setHint(Messages.HintContentSection_2);
createLabel(parent, Messages.HintContentSection_3, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.NONE);
StyledTextControl styledTextControl = createStyledTextControl(parent, SWT.NONE);
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());
}
};
fTextContentControl.setHint(Messages.HintContentSection_5);
// Help
PlatformUI.getWorkbench().getHelpSystem().setHelp(fTextContentControl.getTextControl(), HELP_ID);
}
use of com.archimatetool.editor.ui.components.StyledTextControl 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);
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());
}
};
fTextNotesControl.setHint(Messages.NotesSection_2);
// Help
PlatformUI.getWorkbench().getHelpSystem().setHelp(fTextNotesControl.getTextControl(), HELP_ID);
}
use of com.archimatetool.editor.ui.components.StyledTextControl in project archi by archimatetool.
the class TextContentSection method createControls.
@Override
protected void createControls(Composite parent) {
createLabel(parent, Messages.TextContentSection_0, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.NONE);
StyledTextControl styledTextControl = createStyledTextControl(parent, SWT.NONE);
fTextContentControl = new PropertySectionTextControl(styledTextControl.getControl(), IArchimatePackage.Literals.TEXT_CONTENT__CONTENT) {
@Override
protected void textChanged(String oldText, String newText) {
CompoundCommand result = new CompoundCommand();
for (EObject textContent : getEObjects()) {
if (isAlive(textContent)) {
Command cmd = new EObjectFeatureCommand(Messages.TextContentSection_1, textContent, IArchimatePackage.Literals.TEXT_CONTENT__CONTENT, newText);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
};
fTextContentControl.setHint(Messages.TextContentSection_2);
// Help
PlatformUI.getWorkbench().getHelpSystem().setHelp(fTextContentControl.getTextControl(), HELP_ID);
}
use of com.archimatetool.editor.ui.components.StyledTextControl in project archi by archimatetool.
the class AbstractArchiPropertySection method createStyledTextControl.
/**
* @param parent
* @return A StyledTextControl
*/
protected StyledTextControl createStyledTextControl(Composite parent, int style) {
StyledTextControl styledTextControl = new StyledTextControl(parent, style | SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
// Text textControl = getWidgetFactory().createText(parent, null, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
// This stops excess size if the control contains a lot of text
gd.widthHint = 100;
gd.heightHint = 100;
styledTextControl.getControl().setLayoutData(gd);
return styledTextControl;
}
use of com.archimatetool.editor.ui.components.StyledTextControl in project archi by archimatetool.
the class AbstractECorePropertySection method createDocumentationControl.
/**
* Create a Documentation control
*/
protected PropertySectionTextControl createDocumentationControl(Composite parent, String hint) {
// Label
Label label = createLabel(parent, Messages.AbstractECorePropertySection_2, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.NONE);
// CSS
// $NON-NLS-1$ //$NON-NLS-2$
label.setData("org.eclipse.e4.ui.css.CssClassName", "PropertiesDocumentationLabel");
// Text
StyledTextControl styledTextControl = createStyledTextControl(parent, SWT.NONE);
// CSS
// $NON-NLS-1$ //$NON-NLS-2$
styledTextControl.getControl().setData("org.eclipse.e4.ui.css.CssClassName", "PropertiesDocumentationText");
PropertySectionTextControl textDoc = new PropertySectionTextControl(styledTextControl.getControl(), IArchimatePackage.Literals.DOCUMENTABLE__DOCUMENTATION) {
@Override
protected void textChanged(String oldText, String newText) {
if (fObjects != null) {
CompoundCommand result = new CompoundCommand(Messages.AbstractECorePropertySection_3);
for (EObject eObject : fObjects) {
if (isAlive(eObject)) {
Command cmd = new EObjectFeatureCommand(Messages.AbstractECorePropertySection_3, eObject, IArchimatePackage.Literals.DOCUMENTABLE__DOCUMENTATION, newText);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
}
};
textDoc.setHint(hint);
return textDoc;
}
Aggregations