Examples of ISelection


Examples of org.eclipse.jface.viewers.ISelection

       
        _selectionChangedListener = new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {               
                if (!_table.getSelection().isEmpty()) {
                   
                    ISelection selection = _table.getSelection();
                    if (selection instanceof StructuredSelection) {
                        _selectedRuntime = (WGARuntime) ((StructuredSelection)selection).getFirstElement();                       
                    }
                   
                    Display.getDefault().asyncExec(new Runnable() {
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    _stopWGARuntime.setDisabledImageDescriptor(ImageDescriptor.createFromImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_INAKTIV_WGA_SERVER_STOP)));
    _stopWGARuntime.setEnabled(false);
   
    _doubleClickAction = new Action() {
        public void run() {
            ISelection selection = _table.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            if (obj instanceof WGARuntime) {
                WGARuntime runtime  = (WGARuntime)obj;
                try {
                    runtime.openEditor();
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    }

    @Override
    public void computeResponse() {
        ExportWGAApplication wizard = ((ExportWGAApplication)getWizard());
        ISelection selection = _tblRuntimes.getSelection();
        if (selection instanceof IStructuredSelection) {
            wizard.setRuntime((WGARuntime)((IStructuredSelection)selection).getFirstElement());
        }
    }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

        List<IStatus> errors = new ArrayList<IStatus>();
       
        if (_tblRuntimes.getTable().getSelectionCount() <= 0) {
            errors.add(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a runtime."));
        } else {
            ISelection selection = _tblRuntimes.getSelection();
            if (selection instanceof IStructuredSelection) {
                WGARuntime runtime = (WGARuntime)((IStructuredSelection)selection).getFirstElement();
                validateWGARuntimeVersion(errors, runtime);
            }
           
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    }

    @Override
    public void computeResponse() {
        ExportWGAApplication wizard = (ExportWGAApplication)getWizard();
        ISelection selection = _tblDatabaseServers.getSelection();
        if (selection instanceof IStructuredSelection) {
            wizard.setRemoteDatabaseServer((DatabaseServerInfo)((IStructuredSelection)selection).getFirstElement());
        }
        wizard.setRemoteDatabaseName(_txtDatabaseName.getText());
        wizard.setCopyContent(_chkCopyLocalContent.getSelection());
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    }

    @Override
    public void computeResponse() {
        ExportWGAApplication wizard = ((ExportWGAApplication)getWizard());
        ISelection selection = _tblWebApplications.getSelection();
        if (selection instanceof IStructuredSelection) {
            wizard.setWebApplication((String)((IStructuredSelection)selection).getFirstElement());
        }
    }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

     * in tml-start-tag partionions 'ENTER' and ' ' will be a valid auto activation char
     */
    if (_viewer != null) {
      try {
        IDocument document = _viewer.getDocument();
        ISelection selection =_viewer.getSelectionProvider().getSelection();
        if (selection instanceof TextSelection) {
          TextSelection textSelection = (TextSelection) selection;
          int offset = textSelection.getOffset();
          IRegion region = document.getPartition(offset);
         
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

  public Object execute(ExecutionEvent event) throws ExecutionException {
    IEditorPart editorPart = Plugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editorPart != null && editorPart instanceof ITextEditor) {
      ITextEditor editor = (ITextEditor) editorPart;
      ISelection selection = editor.getEditorSite().getSelectionProvider().getSelection();
      if (selection != null && selection instanceof ITextSelection) {
        ITextSelection textSelection = (ITextSelection) selection;
        IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
        if (doc != null) {
          if(textSelection.getLength()>0){
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    if (editorPart != null) {
      if (editorPart instanceof TMLScriptEditor) {
        return Snippet.CONTEXT_TMLScript;
      } else if (editorPart instanceof TMLEditor) {
        // check if current selection is an tmlscript partion - otherwise return TML-Snippet-Context
        ISelection selection = ((TMLEditor) editorPart).getSelectionProvider().getSelection();
        if (selection instanceof ITextSelection) {
          int selectionOffset = ((TextSelection)selection).getOffset();
          IDocument doc = ((TMLEditor)editorPart).getDocumentProvider().getDocument(editorPart.getEditorInput());
          if (doc != null) {
            ITypedRegion partition;
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

  @Override
  public void run() {
    IEditorPart editorPart = Plugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();   
    if (editorPart != null && editorPart instanceof ITextEditor) {
      ITextEditor editor = (ITextEditor) editorPart;
      ISelection selection = editor.getEditorSite().getSelectionProvider().getSelection();
      if (selection != null && selection instanceof ITextSelection) {
        ITextSelection textSelection = (ITextSelection)selection;
        IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
        if (doc != null) {
          try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.