use of org.eclipse.ui.IEditorDescriptor in project translationstudio8 by heartsome.
the class HtmlBrowserEditor method init.
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
setSite(site);
setInput(input);
setPartName(input.getName());
Image oldTitleImage = titleImage;
if (input != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
titleImage = imageDesc != null ? imageDesc.createImage() : null;
}
setTitleImage(titleImage);
if (oldTitleImage != null && !oldTitleImage.isDisposed()) {
oldTitleImage.dispose();
}
FileEditorInput fileInput = (FileEditorInput) input;
htmlUrl = fileInput.getFile().getLocation().toOSString();
}
use of org.eclipse.ui.IEditorDescriptor in project translationstudio8 by heartsome.
the class XLFEditor method init.
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("init(IEditorSite site, IEditorInput input)");
}
setSite(site);
setInput(input);
// 设置Editor标题栏的显示名称,否则名称用plugin.xml中的name属性
setPartName(input.getName());
Image oldTitleImage = titleImage;
if (input != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
titleImage = imageDesc != null ? imageDesc.createImage() : null;
}
setTitleImage(titleImage);
if (oldTitleImage != null && !oldTitleImage.isDisposed()) {
oldTitleImage.dispose();
}
getSite().setSelectionProvider(this);
cursorIbeam = new Cursor(null, SWT.CURSOR_IBEAM);
cursorArrow = new Cursor(null, SWT.CURSOR_ARROW);
hookListener();
}
use of org.eclipse.ui.IEditorDescriptor in project azure-tools-for-java by Microsoft.
the class UIHelperImpl method openItem.
@Override
public <T extends StorageServiceTreeItem> void openItem(Object projectObject, final ClientStorageAccount clientStorageAccount, final T item, String itemType, String itemName, String iconName) {
// Display.getDefault().syncExec(new Runnable() {
// @Override
// public void run() {
// try {
// BlobExplorerView view = (BlobExplorerView) PlatformUI
// .getWorkbench().getActiveWorkbenchWindow()
// .getActivePage().showView("com.microsoft.azureexplorer.views.BlobExplorerView");
// view.init(storageAccount, (BlobContainer) blobContainer);
// } catch (PartInitException e) {
// Activator.getDefault().log("Error opening container", e);
// }
// }
// });
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor(type2Editor.get(item.getClass()));
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart newEditor = page.openEditor(new StorageEditorInput(clientStorageAccount.getName(), clientStorageAccount.getConnectionString(), item), editorDescriptor.getId());
} catch (PartInitException e) {
Activator.getDefault().log("Error opening " + item.getName(), e);
}
}
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() {
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);
}*/
}
});
}
use of org.eclipse.ui.IEditorDescriptor 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);
}
}
Aggregations