예제 #1
0
  @Override
  protected void doRun(IProgressMonitor progressMonitor) throws Exception {
    CDOTransaction transaction = getTransaction();
    CDOResourceNode node = null;

    if (createFolder) {
      node = EresourceFactory.eINSTANCE.createCDOResourceFolder();
      node.setName(resourceNodeName);
      if (selectedNode instanceof CDOResourceFolder) {
        ((CDOResourceFolder) selectedNode).getNodes().add(node);
      } else {
        ((CDOResource) selectedNode).getContents().add(node);
      }
    } else {
      if (selectedNode instanceof CDOResourceFolder) {
        node =
            transaction.createResource(
                selectedNode.getPath() + "/" + resourceNodeName); // $NON-NLS-1$
      } else {
        node = transaction.createResource(resourceNodeName);
      }
    }

    transaction.commit();

    itemProvider.refreshViewer(true);
    itemProvider.selectElement(node, true);

    if (!createFolder) {
      String resourcePath = node.getPath();
      CDOEditorUtil.openEditor(getPage(), transaction, resourcePath);
    }
  }
예제 #2
0
 @Override
 protected void postRun(CDOView view, CDOObject object) {
   String resourcePath = ((CDOResourceNode) object).getPath() + "/" + getName();
   CDOEditorUtil.openEditor(getPage(), view, resourcePath);
 }
예제 #3
0
 @Override
 protected void doRun(IProgressMonitor progressMonitor) throws Exception {
   CDOEditorUtil.openEditor(getPage(), getView(), resourcePath);
 }