Search in sources :

Example 11 with MultiStatus

use of org.eclipse.core.runtime.MultiStatus in project erlide_eclipse by erlang.

the class ErlangCoreLogger method logErrorStatus.

public void logErrorStatus(final String message, final IStatus status) {
    if (status == null) {
        logErrorMessage(message);
        return;
    }
    final MultiStatus multi = new MultiStatus(plugin.getBundle().getSymbolicName(), ErlangStatus.INTERNAL_ERROR.getValue(), message, null);
    multi.add(status);
    log(multi);
}
Also used : MultiStatus(org.eclipse.core.runtime.MultiStatus)

Example 12 with MultiStatus

use of org.eclipse.core.runtime.MultiStatus in project erlide_eclipse by erlang.

the class ErlideUIPlugin method logErrorStatus.

public static void logErrorStatus(final String message, final IStatus status) {
    if (status == null) {
        ErlideUIPlugin.logErrorMessage(message);
        return;
    }
    final MultiStatus multi = new MultiStatus(ErlideUIPlugin.PLUGIN_ID, ErlangStatus.INTERNAL_ERROR.getValue(), message, null);
    multi.add(status);
    log(multi);
}
Also used : MultiStatus(org.eclipse.core.runtime.MultiStatus)

Example 13 with MultiStatus

use of org.eclipse.core.runtime.MultiStatus in project vorto by eclipse.

the class VortoProgressMonitor method display.

public void display() {
    List<Status> buildResults = new ArrayList<>();
    String message;
    if (!generatorStatusList.isEmpty()) {
        buildResults.add(new MultiStatus(PLUGIN_ID, IStatus.INFO, generatorStatusList.toArray(new Status[] {}), "Code Generator Status Messages", null));
    }
    if (!infrastructureStatusList.isEmpty()) {
        buildResults.add(new MultiStatus(PLUGIN_ID, IStatus.INFO, infrastructureStatusList.toArray(new Status[] {}), "Code Generator Infrastructure Status Messages", null));
    }
    if (warningPresent) {
        message = "Code generation finished with warnings!";
    } else {
        message = "Code generation successul!";
    }
    MessageDisplayFactory.getMessageDisplay().displayStatus(new MultiStatus(PLUGIN_ID, IStatus.INFO, buildResults.toArray(new Status[] {}), message, null));
    /* Reset status lists */
    generatorStatusList = new ArrayList<>();
    infrastructureStatusList = new ArrayList<>();
    warningPresent = false;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) MultiStatus(org.eclipse.core.runtime.MultiStatus) Status(org.eclipse.core.runtime.Status) ArrayList(java.util.ArrayList) MultiStatus(org.eclipse.core.runtime.MultiStatus)

Example 14 with MultiStatus

use of org.eclipse.core.runtime.MultiStatus in project tmdm-studio-se by Talend.

the class DeployStatusDialog method initMultiStatus.

@Override
protected IStatus initMultiStatus(IStatus multiStatus) {
    IStatus[] children = multiStatus.getChildren();
    Map<ERepositoryObjectType, List<IStatus>> map = new HashMap<ERepositoryObjectType, List<IStatus>>();
    for (IStatus status : children) {
        collectTypeStatus(map, status);
    }
    // $NON-NLS-1$
    MultiStatus retStatus = new MultiStatus(RepositoryPlugin.PLUGIN_ID, Status.OK, "", null);
    for (Entry<ERepositoryObjectType, List<IStatus>> entry : map.entrySet()) {
        ERepositoryObjectType key = entry.getKey();
        IInteractiveHandler handler = InteractiveService.findHandler(key);
        if (handler != null) {
            MultiStatus submultiStatus = new DeployCategoryStatus(RepositoryPlugin.PLUGIN_ID, Status.OK, Messages.bind(Messages.MultiStatusDialog_MultiStatus_Messages, key.getLabel()), null);
            for (IStatus status : entry.getValue()) {
                if (isShown(handler, status)) {
                    submultiStatus.add(status);
                }
            }
            if (submultiStatus.getChildren().length > 0) {
                retStatus.add(submultiStatus);
            }
        }
    }
    isShowWarningMsg = map.containsKey(IServerObjectRepositoryType.TYPE_VIEW) && (!map.containsKey(IServerObjectRepositoryType.TYPE_DATAMODEL));
    map.clear();
    return retStatus;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) DeployCategoryStatus(org.talend.mdm.repository.core.service.DeployService.DeployCategoryStatus) HashMap(java.util.HashMap) MultiStatus(org.eclipse.core.runtime.MultiStatus) IInteractiveHandler(org.talend.mdm.repository.core.service.IInteractiveHandler) ArrayList(java.util.ArrayList) List(java.util.List) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType)

Example 15 with MultiStatus

use of org.eclipse.core.runtime.MultiStatus in project tmdm-studio-se by Talend.

the class ExportDataClusterAction method doRun.

@Override
protected void doRun() {
    List<Object> selectedObject = getSelectedObject();
    if (!selectedObject.isEmpty()) {
        IRepositoryViewObject viewObj = (IRepositoryViewObject) selectedObject.get(0);
        SelectServerDefDialog dialog = new SelectServerDefDialog(getShell());
        if (dialog.open() == IDialogConstants.OK_ID) {
            MDMServerDef serverDef = dialog.getSelectedServerDef();
            MDMServerObjectItem item = (MDMServerObjectItem) viewObj.getProperty().getItem();
            String dName = item.getMDMServerObject().getName();
            try {
                FileDialog fd = new FileDialog(getShell(), SWT.SAVE);
                // $NON-NLS-1$
                fd.setFilterExtensions(new String[] { "*.zip" });
                String fPath = fd.open();
                if (fPath != null) {
                    TMDMService service = RepositoryWebServiceAdapter.getMDMService(serverDef);
                    service.ping(new WSPing(Messages.ExportDataClusterAction_exportContent));
                    DataClusterService dataClusterService = DataClusterService.getIntance();
                    if (dataClusterService.isExistDataCluster(service, dName)) {
                        File tempFolder = IOUtil.getTempFolder();
                        String tempFolderPath = tempFolder.getAbsolutePath();
                        dataClusterService.storeIndexFile(tempFolderPath, dName);
                        // 
                        IDataContentProcess process = dataClusterService.getNewExportContentProcess(service, tempFolderPath, dName, fPath);
                        try {
                            process.run();
                        } catch (InterruptedException e) {
                            // do nothing
                            return;
                        }
                        MultiStatus status = process.getResult();
                        if (status != null && status.getChildren().length > 0) {
                            MessageDialog.openError(getShell(), Messages._Error, Messages.bind(Messages.ExportDataClusterAction_failedExportContent, dName));
                        } else {
                            MessageDialog.openInformation(getShell(), Messages.ExportDataClusterAction_exportContent, Messages.bind(Messages.ExportDataClusterAction_successExport, dName));
                        }
                    } else {
                        MessageDialog.openInformation(getShell(), Messages.Common_Warning, Messages.bind(Messages.ExportDataClusterAction_noContainerFound, dName));
                    }
                }
            } catch (XtentisException e) {
                log.error(e.getMessage(), e);
            } catch (WebServiceException e) {
                MessageDialog.openError(getShell(), Messages.ExportDataClusterAction_exportContent, Messages.AbstractDataClusterAction_ConnectFailed);
            }
        }
    }
}
Also used : WSPing(com.amalto.workbench.webservices.WSPing) DataClusterService(org.talend.mdm.repository.core.service.DataClusterService) WebServiceException(javax.xml.ws.WebServiceException) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) IDataContentProcess(org.talend.mdm.repository.core.datacontent.IDataContentProcess) MultiStatus(org.eclipse.core.runtime.MultiStatus) TMDMService(com.amalto.workbench.webservices.TMDMService) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) FileDialog(org.eclipse.swt.widgets.FileDialog) File(java.io.File) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef) XtentisException(com.amalto.workbench.utils.XtentisException)

Aggregations

MultiStatus (org.eclipse.core.runtime.MultiStatus)140 IStatus (org.eclipse.core.runtime.IStatus)98 Status (org.eclipse.core.runtime.Status)60 CoreException (org.eclipse.core.runtime.CoreException)41 ArrayList (java.util.ArrayList)29 File (java.io.File)24 SubMonitor (org.eclipse.core.runtime.SubMonitor)24 IOException (java.io.IOException)14 InvocationTargetException (java.lang.reflect.InvocationTargetException)13 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)13 List (java.util.List)11 HashMap (java.util.HashMap)10 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)10 IPath (org.eclipse.core.runtime.IPath)8 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)8 FileNotFoundException (java.io.FileNotFoundException)7 HashSet (java.util.HashSet)7 IProject (org.eclipse.core.resources.IProject)7 IContainer (org.eclipse.core.resources.IContainer)6 URI (java.net.URI)5