use of org.eclipse.ui.IWorkbench in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method openJobViewEditor.
public void openJobViewEditor(Object projectObject, String uuid) {
try {
loadHDInsightPlugin();
} catch (BundleException bundleException) {
Activator.getDefault().log("Error loading plugin " + HDINSIHGT_BUNDLE_ID, bundleException);
}
IClusterDetail clusterDetail = JobViewManager.getCluster(uuid);
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, uuid), editorDescriptor.getId());
} catch (PartInitException e2) {
Activator.getDefault().log("Error opening " + clusterDetail.getName(), e2);
}
}
use of org.eclipse.ui.IWorkbench in project azure-tools-for-java by Microsoft.
the class UIHelperImpl method refreshBlobs.
@Override
public void refreshBlobs(Object projectObject, final String accountName, final BlobContainer container) {
IWorkbench workbench = PlatformUI.getWorkbench();
final IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor("com.microsoft.azuretools.azureexplorer.editors.BlobExplorerFileEditor");
DefaultLoader.getIdeHelper().invokeLater(new Runnable() {
public void run() {
//TODO
// try {
// IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
// BlobExplorerFileEditor newEditor = (BlobExplorerFileEditor) page.openEditor(new StorageEditorInput(storageAccount, container), editorDescriptor.getId());
// newEditor.fillGrid();
// } catch (PartInitException e) {
// Activator.getDefault().log("Error opening container", e);
// }
}
});
}
use of org.eclipse.ui.IWorkbench in project azure-tools-for-java by Microsoft.
the class AILibraryUtil method getSelectedProject.
/**
* This method returns currently selected project in workspace.
*
* @return IProject
*/
public static IProject getSelectedProject() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
ISelectionService service = window.getSelectionService();
ISelection selection = service.getSelection();
Object element = null;
IResource resource;
IProject selProject = null;
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSel = (IStructuredSelection) selection;
element = structuredSel.getFirstElement();
}
if (element instanceof IProject) {
resource = (IResource) element;
selProject = resource.getProject();
} else if (element instanceof IJavaProject) {
IJavaProject proj = ((IJavaElement) element).getJavaProject();
selProject = proj.getProject();
}
return selProject;
}
use of org.eclipse.ui.IWorkbench in project azure-tools-for-java by Microsoft.
the class ClasspathContainerPage method getSelectedProject.
/**
* This method returns currently selected project in workspace.
* @return IProject
*/
private IProject getSelectedProject() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
ISelectionService service = window.getSelectionService();
ISelection selection = service.getSelection();
Object element = null;
IResource resource;
IProject selProject = null;
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSel = (IStructuredSelection) selection;
element = structuredSel.getFirstElement();
}
if (element instanceof IProject) {
resource = (IResource) element;
selProject = resource.getProject();
} else if (element instanceof IJavaProject) {
IJavaProject proj = ((IJavaElement) element).getJavaProject();
selProject = proj.getProject();
}
return selProject;
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class ShowBreakpointAction method run.
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
ComponentSettingsView view;
try {
view = (ComponentSettingsView) page.showView(ComponentSettingsView.ID);
view.setElement(connection);
view.selectTab(EComponentCategory.BREAKPOINT);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations