use of org.obeonetwork.tools.requirement.core.RequirementLink in project InformationSystem by ObeoNetwork.
the class EditRequirementAction method run.
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
RequirementLink eObjectLink = (RequirementLink) linksView.getSelectedEntries().get(0);
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(linksView.getInput());
DomainPropertiesEditionContext propertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, linksView.getAdapterFactory(), eObjectLink.getRequirement());
WizardEditingOperation operation = new RequirementEditingOperation(propertiesEditionContext);
try {
operation.execute(new NullProgressMonitor(), null);
linksView.refresh();
} catch (ExecutionException e) {
// $NON-NLS-1$
EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
}
}
use of org.obeonetwork.tools.requirement.core.RequirementLink in project InformationSystem by ObeoNetwork.
the class LinkedRequirementsView method createDoubleClickAction.
/**
* {@inheritDoc}
*
* @see org.obeonetwork.tools.linker.ui.view.EObjectLinksView#createDoubleClickAction()
*/
@Override
protected Action createDoubleClickAction() {
return new Action() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
if (getSelectedEntries().size() > 0) {
RequirementLink eObjectLink = (RequirementLink) getSelectedEntries().get(0);
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getInput());
DomainPropertiesEditionContext propertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, adapterFactory, eObjectLink.getRequirement());
WizardEditingOperation operation = new RequirementEditingOperation(propertiesEditionContext);
try {
operation.execute(new NullProgressMonitor(), null);
refresh();
} catch (ExecutionException e) {
// $NON-NLS-1$
EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
}
}
}
};
}
use of org.obeonetwork.tools.requirement.core.RequirementLink in project InformationSystem by ObeoNetwork.
the class LinkedRequirementsView method createFilters.
/**
* {@inheritDoc}
*
* @see org.obeonetwork.tools.linker.ui.view.EObjectLinksView#createFilters()
*/
@Override
protected List<ViewerFilter> createFilters() {
List<ViewerFilter> result = new ArrayList<ViewerFilter>();
result.add(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return element instanceof RequirementLink;
}
});
return result;
}
use of org.obeonetwork.tools.requirement.core.RequirementLink in project InformationSystem by ObeoNetwork.
the class UnlinkRequirementAction method run.
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
MessageDialog dialog = new MessageDialog(linksView.getSite().getShell(), // $NON-NLS-1$
RequirementLinkerPlugin.getInstance().getString("DeleteRequirementLinkAction_ConfirmDialog_title"), null, // $NON-NLS-1$
RequirementLinkerPlugin.getInstance().getString("DeleteRequirementLinkAction_ConfirmDialog_msg"), MessageDialog.CONFIRM, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 1);
boolean openConfirm = dialog.open() == Window.OK;
if (openConfirm) {
Session session = new EObjectQuery(linksView.getInput()).getSession();
if (session != null) {
TransactionalEditingDomain editingDomain = session.getTransactionalEditingDomain();
RecordingCommand cmd = new // $NON-NLS-1$
RecordingCommand(// $NON-NLS-1$
editingDomain, // $NON-NLS-1$
"UnLink Requirements") {
protected void doExecute() {
for (EObjectLink link : linksView.getSelectedEntries()) {
if (link instanceof RequirementLink) {
RequirementLink reqLink = (RequirementLink) link;
reqLink.getRequirement().getReferencedObject().remove(linksView.getInput());
}
}
}
};
editingDomain.getCommandStack().execute(cmd);
}
linksView.refresh();
}
}
Aggregations