Search in sources :

Example 1 with DOMViewDialog

use of com.amalto.workbench.dialogs.DOMViewDialog in project tmdm-studio-se by Talend.

the class EditItemAction method run.

@Override
public void run() {
    try {
        super.run();
        IStructuredSelection selection = ((IStructuredSelection) viewer.getSelection());
        if (selection.isEmpty()) {
            return;
        }
        WSRoutingOrderV2 routingOrder = (WSRoutingOrderV2) selection.getFirstElement();
        StringWriter sw = new StringWriter();
        Marshaller.marshal(routingOrder, sw);
        final DOMViewDialog d = new DOMViewDialog(shell, Util.parse(sw.toString()));
        d.addListener(new Listener() {

            public void handleEvent(Event event) {
                d.close();
            }
        });
        d.setBlockOnOpen(true);
        d.open();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        MessageDialog.openError(shell, Messages._Error, Messages.bind(Messages.RoutingEngineV2BrowserMainPage_ErrorToViewRoutingOrder, e.getLocalizedMessage()));
    }
}
Also used : Listener(org.eclipse.swt.widgets.Listener) StringWriter(java.io.StringWriter) WSRoutingOrderV2(com.amalto.workbench.webservices.WSRoutingOrderV2) Event(org.eclipse.swt.widgets.Event) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) DOMViewDialog(com.amalto.workbench.dialogs.DOMViewDialog)

Aggregations

DOMViewDialog (com.amalto.workbench.dialogs.DOMViewDialog)1 WSRoutingOrderV2 (com.amalto.workbench.webservices.WSRoutingOrderV2)1 StringWriter (java.io.StringWriter)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 Event (org.eclipse.swt.widgets.Event)1 Listener (org.eclipse.swt.widgets.Listener)1