Search in sources :

Example 1 with SetPriorityAction

use of eu.esdihumboldt.hale.ui.function.contribution.internal.SetPriorityAction in project hale by halestudio.

the class SetPriorityContribution method fill.

/**
 * @see AbstractFunctionWizardContribution#fill(Menu, int)
 */
@Override
public void fill(Menu menu, int index) {
    if (getOriginalCell() == null)
        return;
    AlignmentService alignmentService = PlatformUI.getWorkbench().getService(AlignmentService.class);
    Cell cell = getOriginalCell();
    Priority oldPriority = cell.getPriority();
    for (Priority priority : Priority.values()) {
        if (priority != oldPriority) {
            SetPriorityAction setPriorityAction = new SetPriorityAction(priority, cell.getId(), alignmentService);
            IContributionItem item = new ActionContributionItem(setPriorityAction);
            item.fill(menu, index++);
        }
    }
}
Also used : SetPriorityAction(eu.esdihumboldt.hale.ui.function.contribution.internal.SetPriorityAction) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) AlignmentService(eu.esdihumboldt.hale.ui.service.align.AlignmentService) Priority(eu.esdihumboldt.hale.common.align.model.Priority) IContributionItem(org.eclipse.jface.action.IContributionItem) Cell(eu.esdihumboldt.hale.common.align.model.Cell)

Aggregations

Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 Priority (eu.esdihumboldt.hale.common.align.model.Priority)1 SetPriorityAction (eu.esdihumboldt.hale.ui.function.contribution.internal.SetPriorityAction)1 AlignmentService (eu.esdihumboldt.hale.ui.service.align.AlignmentService)1 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1