Package org.eclipse.ui

Examples of org.eclipse.ui.ISelectionService


        // (such as widgets, colors, images and fonts)
        // please be careful not to assume that createPartControl has been called
        if( selectionListener != null ){
            // if our init method failed selectionListener would be null!
            //
            ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
            selectionService.removePostSelectionListener(selectionListener);
           
            selectionListener = null;
        }
        super.dispose();
    }
View Full Code Here


            if (deleteAction == null) {
                 deleteAction = new Action(){
                    @Override
                    public void run() {
                        IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                        ISelectionService selectionService = workbenchWindow.getSelectionService();
                        ISelection selection = selectionService.getSelection();
                       
                        Delete delete=new Delete( false );
                        delete.selectionChanged(this, selection);
                        delete.run(this);
                    }
View Full Code Here

    @Override
    public void createPartControl(Composite parent) {
        super.createPartControl(parent);
        // Add selection listener to detect click in problems view or in tree
        // view
        ISelectionService theService = getSite().getWorkbenchWindow().getSelectionService();
        selectionListener = new MarkerSelectionListener(this) {
            @Override
            public void selectionChanged(IWorkbenchPart thePart, ISelection theSelection) {
                selectionInProgress = true;
                super.selectionChanged(thePart, theSelection);
                selectionInProgress = false;
            }
        };
        theService.addSelectionListener(selectionListener);
        getCommonViewer().addSelectionChangedListener(this);
    }
View Full Code Here

    IDE.openEditor(activePage, project.getFile("/src/main/java/org/qwickie/test/project/issue45/mobile/RegistrationPage.java"), true);

    final Region region = new Region(21 * 25, 1);
    WicketHyperlink wh = new WicketHyperlink(region, "test", "html");
    wh.open();
    final ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
    final ITextSelection selection = (ITextSelection) selectionService.getSelection();
    assertEquals("test", selection.getText());
    assertEquals(7, selection.getStartLine());
    assertEquals(7, selection.getEndLine());
    final IResource resource = ResourceUtil.getResource(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput());
    assertEquals("RegistrationPage.html", resource.getName());
View Full Code Here

    IDE.openEditor(activePage, project.getFile("/src/main/resources/org/qwickie/test/project/issue45/mobile/RegistrationPage.html"), true);

    final Region region = new Region(263, 1);
    WicketHyperlink wh = new WicketHyperlink(region, "test", "java");
    wh.open();
    final ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
    final ITextSelection selection = (ITextSelection) selectionService.getSelection();
    assertEquals("test", selection.getText());
    assertEquals(21, selection.getStartLine());
    assertEquals(21, selection.getEndLine());
    final IResource resource = ResourceUtil.getResource(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput());
    assertEquals("RegistrationPage.java", resource.getName());
View Full Code Here

    final Region region = new Region(763, 1);
    WicketHyperlink wh = new WicketHyperlink(region, "firstname", "properties");

    wh.open();
    final ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
    final ITextSelection selection = (ITextSelection) selectionService.getSelection();
    assertEquals("Your first name", selection.getText());
    assertEquals(0, selection.getStartLine());
    assertEquals(0, selection.getEndLine());
    final IResource resource = ResourceUtil.getResource(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput());
    assertEquals("wicket-package.properties", resource.getName());
View Full Code Here

public class CheckoutHandler extends AbstractHandler {

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    ISelectionService selectionService = window.getSelectionService();
    ISelection selection = selectionService.getSelection();
   
    if (selection instanceof ITreeSelection && (((ITreeSelection) selection).getFirstElement() instanceof IFile)){
      ITreeSelection treeSelection = (ITreeSelection)selection;
      IFile comp = (IFile) treeSelection.getFirstElement();
      CheckoutJob runner = new CheckoutJob(comp);
View Full Code Here

public class RunHandler  extends AbstractHandler{
  FScript fscript;
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    ISelectionService selectionService = window.getSelectionService();
    ISelection selection = selectionService.getSelection();
   
    if (selection instanceof ITreeSelection && (((ITreeSelection) selection).getFirstElement() instanceof IFolder)){
      ITreeSelection treeSelection = (ITreeSelection)selection;
      IFolder planFolder = (IFolder) treeSelection.getFirstElement();
      RunJob runner = new RunJob(planFolder);
View Full Code Here

   * from the application context.
   */
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
   
    ISelectionService selectionService = window.getSelectionService();
    ISelection selection = selectionService.getSelection();
   
    String targetType = "";
    if (selection instanceof ITextSelection){
      targetType = ((ITextSelection)selection).getText();
     
View Full Code Here

      IEditorSite site = fTextEditor.getEditorSite();
      if (site != null) {
        IWorkbenchWindow window = site.getWorkbenchWindow();
        if (window != null) {
          ISelectionService service = window.getSelectionService();
          ISelection selectionFromService = service.getSelection();
          if (service != null && !selectionFromService.equals(structuredSelection) && selectionFromService instanceof IStructuredSelection) {
            TabItem selectionServiceTab = new TabItem(tabfolder, SWT.BORDER);
            selectionServiceTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_19);
            Composite selectionServiceComposite = new Composite(tabfolder, SWT.NONE);
            selectionServiceTab.setControl(selectionServiceComposite);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ISelectionService

Copyright © 2018 www.massapicom. 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.