use of org.talend.designer.core.ui.editor.cmd.ChangeNoteOpacityCommand in project tdi-studio-se by Talend.
the class NoteEditPart method performRequest.
@Override
public void performRequest(Request request) {
Note note = (Note) getModel();
if (note.isReadOnly()) {
return;
}
if (request.getType() == RequestConstants.REQ_OPEN) {
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (part instanceof AbstractMultiPageTalendEditor) {
CommandStack commandStack = (CommandStack) part.getAdapter(CommandStack.class);
Command command = new ChangeNoteOpacityCommand(note, !note.isOpaque());
commandStack.execute(command);
}
}
if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
if (directEditManager == null) {
NoteFigure noteFigure = (NoteFigure) getFigure();
directEditManager = new NoteDirectEditManager(this, TextCellEditor.class, new NoteCellEditorLocator(noteFigure));
}
directEditManager.show();
}
}
use of org.talend.designer.core.ui.editor.cmd.ChangeNoteOpacityCommand in project tdi-studio-se by Talend.
the class BasicNotePropertyComposite method createControl.
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.core.ui.editor.properties.notes.AbstractNotePropertyComposite#createControl(org.eclipse.swt
* .widgets.Composite)
*/
@Override
public void createControl(Composite parent) {
composite = getWidgetFactory().createFlatFormComposite(parent);
if (composite.getLayout() instanceof FormLayout) {
FormLayout formLayout = (FormLayout) composite.getLayout();
formLayout.spacing = 0;
}
FormData data;
//$NON-NLS-1$
check = getWidgetFactory().createButton(composite, "", SWT.CHECK);
data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
check.setLayoutData(data);
//$NON-NLS-1$
CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("OpaqueNoteSection.Label"));
data = new FormData();
data.left = new FormAttachment(check);
data.top = new FormAttachment(check, 0, SWT.TOP);
labelLabel.setLayoutData(data);
check.setSelection(note.isOpaque());
check.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (check.getSelection() != (note.isOpaque())) {
ChangeNoteOpacityCommand command = new ChangeNoteOpacityCommand(note, check.getSelection());
getCommandStack().execute(command);
}
}
});
createFontsAndColorsGroups(composite);
createAlignGroups(composite);
createTextControl(composite);
refresh();
}
use of org.talend.designer.core.ui.editor.cmd.ChangeNoteOpacityCommand in project tdi-studio-se by Talend.
the class OpaqueNotePropertySection method createControls.
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
Composite composite = getWidgetFactory().createFlatFormComposite(parent);
if (composite.getLayout() instanceof FormLayout) {
FormLayout formLayout = (FormLayout) composite.getLayout();
formLayout.spacing = 0;
}
FormData data;
//$NON-NLS-1$
check = getWidgetFactory().createButton(composite, "", SWT.CHECK);
data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
check.setLayoutData(data);
//$NON-NLS-1$
CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("OpaqueNoteSection.Label"));
data = new FormData();
data.left = new FormAttachment(check);
data.top = new FormAttachment(check, 0, SWT.TOP);
labelLabel.setLayoutData(data);
check.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (check.getSelection() != (note.isOpaque())) {
ChangeNoteOpacityCommand command = new ChangeNoteOpacityCommand(note, check.getSelection());
getCommandStack().execute(command);
}
}
});
}
Aggregations