コード例 #1
0
  public void run(IAction action) {
    try {
      ResourcesPlugin.getWorkspace()
          .run(
              new IWorkspaceRunnable() {

                @Override
                public void run(IProgressMonitor monitor) throws CoreException {
                  doAddNature();
                }
              },
              new NullProgressMonitor());
    } catch (CoreException e) {
      VjetUIPlugin.log(e);
    }
  }
コード例 #2
0
  public void testBug2512() throws Exception {
    String js = "autoEdit/indentTest2512";

    FixtureManager m_fixtureManager = FixtureUtils.setUpFixture(this, js + ".js");
    IFile file =
        ResourcesPlugin.getWorkspace()
            .getRoot()
            .getFile(new Path(getProjectName() + "/src/" + js + ".js"));

    VjoEditor editor =
        (VjoEditor)
            IDE.openEditor(
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), file);

    try {
      IPreferenceStore store = VjetUIPlugin.getDefault().getPreferenceStore();
      testTabSize(store.getInt(CodeFormatterConstants.FORMATTER_TAB_SIZE), editor);
      store.setValue(CodeFormatterConstants.FORMATTER_TAB_SIZE, 10);
      testTabSize(10, editor);

    } finally {
      FixtureUtils.tearDownFixture(m_fixtureManager);
    }
  }