Search in sources :

Example 61 with IEditorDescriptor

use of org.eclipse.ui.IEditorDescriptor in project InformationSystem by ObeoNetwork.

the class BindingTreeEditor method getEditorDescriptor.

/**
 * Retrieves the descriptor for this editor.
 *
 * @return the editor descriptor
 */
protected final IEditorDescriptor getEditorDescriptor() {
    final IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
    final IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
    return editorDesc;
}
Also used : IEditorDescriptor(org.eclipse.ui.IEditorDescriptor) IEditorRegistry(org.eclipse.ui.IEditorRegistry)

Example 62 with IEditorDescriptor

use of org.eclipse.ui.IEditorDescriptor in project ecf by eclipse.

the class EditorHelper method getEditorIdForFile.

protected String getEditorIdForFile(IFile file) {
    final IWorkbench wb = getWorkbenchWindow().getWorkbench();
    final IEditorRegistry er = wb.getEditorRegistry();
    final IEditorDescriptor desc = er.getDefaultEditor(file.getName());
    if (desc != null)
        return desc.getId();
    else
        return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IEditorDescriptor(org.eclipse.ui.IEditorDescriptor) IEditorRegistry(org.eclipse.ui.IEditorRegistry)

Example 63 with IEditorDescriptor

use of org.eclipse.ui.IEditorDescriptor in project azure-tools-for-java by Microsoft.

the class HDInsightHelperImpl method openJobViewEditor.

public void openJobViewEditor(Object projectObject, @NotNull String clusterName) {
    try {
        loadHDInsightPlugin();
    } catch (BundleException bundleException) {
        Activator.getDefault().log("Error loading plugin " + HDINSIHGT_BUNDLE_ID, bundleException);
    }
    IClusterDetail clusterDetail = JobViewManager.getCluster(clusterName);
    IWorkbench workbench = PlatformUI.getWorkbench();
    IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor("com.microsoft.azure.hdinsight.jobview");
    try {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IEditorPart newEditor = page.openEditor(new JobViewInput(clusterDetail), editorDescriptor.getId());
    } catch (PartInitException e2) {
        Activator.getDefault().log("Error opening " + clusterDetail.getName(), e2);
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IEditorDescriptor(org.eclipse.ui.IEditorDescriptor) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) BundleException(org.osgi.framework.BundleException) IEditorPart(org.eclipse.ui.IEditorPart) PartInitException(org.eclipse.ui.PartInitException) IClusterDetail(com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail) JobViewInput(com.microsoft.azuretools.azureexplorer.editors.JobViewInput)

Example 64 with IEditorDescriptor

use of org.eclipse.ui.IEditorDescriptor in project azure-tools-for-java by Microsoft.

the class UIHelperImpl method refreshTable.

@Override
public void refreshTable(Object projectObject, final StorageAccount storageAccount, final Table table) {
    IWorkbench workbench = PlatformUI.getWorkbench();
    final IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor("com.microsoft.azuretools.azureexplorer.editors.TableFileEditor");
    DefaultLoader.getIdeHelper().invokeLater(new Runnable() {

        @Override
        public void run() {
        // TODO
        /*try {
                    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
                    TableFileEditor newEditor = (TableFileEditor) page.openEditor(new StorageEditorInput(storageAccount, table), editorDescriptor.getId());
                    newEditor.fillGrid();
                } catch (PartInitException e) {
                    Activator.getDefault().log("Error opening container", e);
                }*/
        }
    });
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IEditorDescriptor(org.eclipse.ui.IEditorDescriptor)

Example 65 with IEditorDescriptor

use of org.eclipse.ui.IEditorDescriptor in project azure-tools-for-java by Microsoft.

the class UIHelperImpl method openDeploymentSlotPropertyView.

@Override
public void openDeploymentSlotPropertyView(final DeploymentSlotNode node) {
    if (Utils.isEmptyString(node.getId())) {
        return;
    }
    AzureTaskManager.getInstance().runLater(() -> {
        IWorkbench workbench = PlatformUI.getWorkbench();
        DeploymentSlotPropertyEditorInput input = new DeploymentSlotPropertyEditorInput(node.getId(), node.getSubscriptionId(), node.getWebAppId(), node.getName());
        IEditorDescriptor descriptor = workbench.getEditorRegistry().findEditor(DeploymentSlotEditor.ID);
        openEditor(EditorType.WEBAPP_EXPLORER, input, descriptor);
    });
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) DeploymentSlotPropertyEditorInput(com.microsoft.azuretools.azureexplorer.editors.webapp.DeploymentSlotPropertyEditorInput) IEditorDescriptor(org.eclipse.ui.IEditorDescriptor)

Aggregations

IEditorDescriptor (org.eclipse.ui.IEditorDescriptor)74 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)34 PartInitException (org.eclipse.ui.PartInitException)34 FileEditorInput (org.eclipse.ui.part.FileEditorInput)27 IWorkbench (org.eclipse.ui.IWorkbench)25 IEditorPart (org.eclipse.ui.IEditorPart)21 IFile (org.eclipse.core.resources.IFile)19 IEditorRegistry (org.eclipse.ui.IEditorRegistry)18 CoreException (org.eclipse.core.runtime.CoreException)10 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)10 IEditorInput (org.eclipse.ui.IEditorInput)8 IContentType (org.eclipse.core.runtime.content.IContentType)7 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)7 AbstractTextEditor (org.eclipse.ui.texteditor.AbstractTextEditor)7 Image (org.eclipse.swt.graphics.Image)5 InputStream (java.io.InputStream)4 BadLocationException (org.eclipse.jface.text.BadLocationException)4 Path (org.eclipse.core.runtime.Path)3 IContentDescription (org.eclipse.core.runtime.content.IContentDescription)3 JavaModelException (org.eclipse.jdt.core.JavaModelException)3