Skip to main content
summaryrefslogtreecommitdiffstats
blob: ea983fef269052ecc26dc57493154457f22cd5f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.releng.manifests;

import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.dialogs.PropertyDialogAction;

/**
 * @author Eike Stepper
 */
public class OpenPropertiesHandler extends AbstractProjectHandler
{
  public OpenPropertiesHandler()
  {
  }

  @Override
  protected void execute(IWorkbenchPage page, final IProject project)
  {
    PropertyDialogAction action = new PropertyDialogAction(page.getWorkbenchWindow(), new ISelectionProvider()
    {
      public ISelection getSelection()
      {
        return new StructuredSelection(project);
      }

      public void setSelection(ISelection selection)
      {
      }

      public void addSelectionChangedListener(ISelectionChangedListener listener)
      {
      }

      public void removeSelectionChangedListener(ISelectionChangedListener listener)
      {
      }
    });

    try
    {
      action.runWithEvent(null);
    }
    finally
    {
      action.dispose();
    }
  }
}

Back to the top