use of eu.esdihumboldt.hale.common.align.model.Cell in project hale by halestudio.
the class CellPrioritySection method refresh.
@Override
public void refresh() {
super.refresh();
Cell cell = getCell();
if (cell != null) {
comboViewer.getControl().setEnabled(true);
setFromCell();
} else {
comboViewer.getControl().setEnabled(false);
}
}
use of eu.esdihumboldt.hale.common.align.model.Cell in project hale by halestudio.
the class CellPrioritySection method selectionChanged.
/**
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
@Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
Object firstElement = structuredSelection.getFirstElement();
if (firstElement instanceof Priority) {
Priority priority = (Priority) firstElement;
Cell cell = getCell();
if (cell.getPriority() != priority) {
AlignmentService alignmentService = PlatformUI.getWorkbench().getService(AlignmentService.class);
alignmentService.setCellProperty(cell.getId(), Cell.PROPERTY_PRIORITY, priority);
}
}
}
}
use of eu.esdihumboldt.hale.common.align.model.Cell in project hale by halestudio.
the class CellPrioritySection method setFromCell.
private void setFromCell() {
Cell cell = getCell();
Priority currentPriority = cell.getPriority();
comboViewer.setSelection(new StructuredSelection(currentPriority));
}
use of eu.esdihumboldt.hale.common.align.model.Cell in project hale by halestudio.
the class NotesCellSection method refresh.
@Override
public void refresh() {
super.refresh();
Cell cell = getCell();
if (cell != null) {
String notes = CellUtil.getNotes(cell);
if (notes == null) {
notes = "";
}
textField.setText(notes);
textField.setEnabled(!cell.isBaseCell());
} else {
textField.setText("");
textField.setEnabled(false);
}
}
use of eu.esdihumboldt.hale.common.align.model.Cell in project hale by halestudio.
the class NotesCellSection method createControls.
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
Composite page = getWidgetFactory().createComposite(parent);
page.setLayout(GridLayoutFactory.fillDefaults().margins(8, 8).create());
textField = new Text(page, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
textField.setLayoutData(GridDataFactory.fillDefaults().hint(17, 17).grab(true, true).create());
textField.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
Cell cell = getCell();
if (cell != null && !cell.isBaseCell()) {
String cellNotes = CellUtil.getNotes(cell);
if (cellNotes == null) {
cellNotes = "";
}
String notes = textField.getText();
if (!notes.equals(cellNotes)) {
CellUtil.setNotes(cell, notes);
ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
if (ps != null) {
ps.setChanged();
}
}
}
}
});
}
Aggregations