Search in sources :

Example 16 with IWorkbenchWindow

use of org.eclipse.ui.IWorkbenchWindow in project dbeaver by serge-rider.

the class ApplicationWorkbenchWindowAdvisor method postWindowCreate.

@Override
public void postWindowCreate() {
    log.debug("Initialize workbench window");
    final IWorkbenchWindow window = getWindowConfigurer().getWindow();
    UIUtils.updateMainWindowTitle(window);
    try {
        DBeaverApplication.executeCommandLineCommands(DBeaverApplication.getCommandLine(), DBeaverApplication.getInstance().getInstanceServer());
    } catch (Exception e) {
        log.error("Error processing command line", e);
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) CoreException(org.eclipse.core.runtime.CoreException)

Example 17 with IWorkbenchWindow

use of org.eclipse.ui.IWorkbenchWindow in project meclipse by flaper87.

the class ConnectionEditorCall method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    // Get the view
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    IWorkbenchPage page = window.getActivePage();
    MeclipseView view = (MeclipseView) page.findView(MeclipseView.ID);
    // Get the selection
    IStructuredSelection selection = (IStructuredSelection) view.getViewer().getSelection();
    if (selection != null && selection instanceof IStructuredSelection) {
        Collection obj = (Collection) selection.getFirstElement();
        // If we had a selection lets open the editor
        if (obj != null) {
            CollectionEditorInput input = new CollectionEditorInput(obj);
            try {
                page.openEditor(input, CollectionEditor.ID);
            } catch (PartInitException e) {
                System.out.println(e.getStackTrace());
            }
        }
    }
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) MeclipseView(org.mongodb.meclipse.views.MeclipseView) CollectionEditorInput(org.mongodb.meclipse.editors.CollectionEditorInput) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) Collection(org.mongodb.meclipse.views.objects.Collection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException)

Example 18 with IWorkbenchWindow

use of org.eclipse.ui.IWorkbenchWindow in project translationstudio8 by heartsome.

the class NewTBHandler method execute.

public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    NewTermDbWizard wizard = new NewTermDbWizard();
    TermDbManagerImportWizardDialog dialog = new TermDbManagerImportWizardDialog(window.getShell(), wizard);
    dialog.open();
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) TermDbManagerImportWizardDialog(net.heartsome.cat.database.ui.tb.wizard.TermDbManagerImportWizardDialog) NewTermDbWizard(net.heartsome.cat.database.ui.tb.wizard.NewTermDbWizard)

Example 19 with IWorkbenchWindow

use of org.eclipse.ui.IWorkbenchWindow in project translationstudio8 by heartsome.

the class TermDbManageHandler method execute.

public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    TermDbManagerDialog dialog = new TermDbManagerDialog(window.getShell());
    dialog.setDialogUseFor(TermDbManagerDialog.TYPE_DBMANAGE);
    dialog.open();
    return null;
}
Also used : TermDbManagerDialog(net.heartsome.cat.database.ui.tb.dialog.TermDbManagerDialog) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow)

Example 20 with IWorkbenchWindow

use of org.eclipse.ui.IWorkbenchWindow in project translationstudio8 by heartsome.

the class ImportTbxHandler method execute.

/**
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    TermDbManagerImportWizard wizard = new TermDbManagerImportWizard();
    TermDbManagerImportWizardDialog dlg = new TermDbManagerImportWizardDialog(window.getShell(), wizard) {

        // robert help 2012-09-06
        @Override
        protected Control createHelpControl(Composite parent) {
            // ROBERTHELP 导入TBX
            String language = CommonFunction.getSystemLanguage();
            final String helpUrl = MessageFormat.format("/net.heartsome.cat.ts.ui.help/html/{0}/ch05s03.html#create-tb-wizard-import-tbx", language);
            Image helpImage = JFaceResources.getImage(DLG_IMG_HELP);
            ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
            ((GridLayout) parent.getLayout()).numColumns++;
            toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
            final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
            toolBar.setCursor(cursor);
            toolBar.addDisposeListener(new DisposeListener() {

                public void widgetDisposed(DisposeEvent e) {
                    cursor.dispose();
                }
            });
            ToolItem helpItem = new ToolItem(toolBar, SWT.NONE);
            helpItem.setImage(helpImage);
            //$NON-NLS-1$
            helpItem.setToolTipText(JFaceResources.getString("helpToolTip"));
            helpItem.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent e) {
                    PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpUrl);
                }
            });
            return toolBar;
        }
    };
    dlg.setHelpAvailable(true);
    dlg.open();
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) DisposeListener(org.eclipse.swt.events.DisposeListener) TermDbManagerImportWizardDialog(net.heartsome.cat.database.ui.tb.wizard.TermDbManagerImportWizardDialog) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Image(org.eclipse.swt.graphics.Image) Cursor(org.eclipse.swt.graphics.Cursor) DisposeEvent(org.eclipse.swt.events.DisposeEvent) TermDbManagerImportWizard(net.heartsome.cat.database.ui.tb.wizard.TermDbManagerImportWizard) ToolBar(org.eclipse.swt.widgets.ToolBar) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ToolItem(org.eclipse.swt.widgets.ToolItem)

Aggregations

IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)284 IEditorPart (org.eclipse.ui.IEditorPart)114 PartInitException (org.eclipse.ui.PartInitException)70 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)68 QueryEditorPart (com.cubrid.common.ui.query.editor.QueryEditorPart)39 IViewPart (org.eclipse.ui.IViewPart)38 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)35 ArrayList (java.util.ArrayList)34 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)32 IEditorReference (org.eclipse.ui.IEditorReference)30 XLIFFEditorImplWithNatTable (net.heartsome.cat.ts.ui.xliffeditor.nattable.editor.XLIFFEditorImplWithNatTable)27 ISelection (org.eclipse.jface.viewers.ISelection)25 XLFHandler (net.heartsome.cat.ts.core.file.XLFHandler)24 IFile (org.eclipse.core.resources.IFile)23 IWorkbench (org.eclipse.ui.IWorkbench)21 CoreException (org.eclipse.core.runtime.CoreException)20 QueryUnit (com.cubrid.common.ui.query.editor.QueryUnit)19 IProject (org.eclipse.core.resources.IProject)19 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)17 TreeViewer (org.eclipse.jface.viewers.TreeViewer)17