use of org.eclipse.ui.PartInitException in project dbeaver by serge-rider.
the class NavigatorHandlerProjectSelect method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final DBeaverCore core = DBeaverCore.getInstance();
final DBNProject projectNode = core.getNavigatorModel().getRoot().getProject(core.getProjectRegistry().getActiveProject());
if (projectNode != null) {
final IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
try {
final ProjectNavigatorView projectsView = (ProjectNavigatorView) workbenchWindow.getActivePage().showView(ProjectNavigatorView.VIEW_ID);
if (projectsView != null) {
projectsView.showNode(projectNode);
}
} catch (PartInitException e) {
log.error(e);
}
}
return null;
}
use of org.eclipse.ui.PartInitException in project dbeaver by serge-rider.
the class XMLPanelEditor method createControl.
@Override
public StyledText createControl(IValueController valueController) {
this.valueController = valueController;
this.subSite = new SubEditorSite(valueController.getValueSite());
editor = new XMLEditor();
try {
editor.init(subSite, StringEditorInput.EMPTY_INPUT);
} catch (PartInitException e) {
valueController.showMessage(e.getMessage(), DBPMessageType.ERROR);
return new StyledText(valueController.getEditPlaceholder(), SWT.NONE);
}
editor.createPartControl(valueController.getEditPlaceholder());
ContentPanelEditor.setEditorSettings(editor.getEditorControl());
return editor.getEditorControl();
}
use of org.eclipse.ui.PartInitException in project translationstudio8 by heartsome.
the class OpenViewHandler method execute.
/**
* the command has been executed, so extract extract the needed information from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
String viewId = event.getParameter("ViewId");
if (viewId == null) {
return null;
}
IWorkbenchPage workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = workbenchPage.findView(viewId);
if (view == null) {
try {
workbenchPage.showView(viewId);
} catch (PartInitException e) {
e.printStackTrace();
}
} else {
workbenchPage.hideView(view);
}
// commandService.refreshElements(event.getCommand().getId(), null);
return null;
}
use of org.eclipse.ui.PartInitException in project translationstudio8 by heartsome.
the class WebSearchHandler method execute.
/** (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
String selectPureText = "";
if (editor instanceof IXliffEditor) {
IXliffEditor xliffEditor = (IXliffEditor) editor;
selectPureText = xliffEditor.getSelectPureText();
}
try {
IViewPart showView = getActivePage().showView(BrowserViewPart.ID);
if (showView instanceof BrowserViewPart) {
BrowserViewPart browserViewPart = (BrowserViewPart) showView;
browserViewPart.setKeyWord(selectPureText, true);
}
} catch (PartInitException e) {
e.printStackTrace();
logger.error("", e);
}
return null;
}
use of org.eclipse.ui.PartInitException in project translationstudio8 by heartsome.
the class EditProgressFA method printTransProgFAReslut.
public void printTransProgFAReslut() {
String htmlPath = createFAResultHtml();
try {
model.getAnalysisIFileList().get(0).getProject().getFolder("Intermediate").getFolder("Report").refreshLocal(IResource.DEPTH_ONE, null);
} catch (CoreException e1) {
e1.printStackTrace();
logger.error(Messages.getString("qa.fileAnalysis.EditProgressFA.log1"), e1);
}
final FileEditorInput input = new FileEditorInput(ResourceUtils.fileToIFile(htmlPath));
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, QAConstant.FA_HtmlBrowserEditor, true);
} catch (PartInitException e) {
e.printStackTrace();
logger.error(Messages.getString("qa.fileAnalysis.EditProgressFA.log2"), e);
}
}
});
}
Aggregations