简体   繁体   English

如何在没有工作空间和其他Eclipse默认功能的情况下创建RCP项目?

[英]How to create RCP project without a workspace and other Eclipse default features?

How to create RCP project without a workspace and other Eclipse default features? 如何在没有工作空间和其他Eclipse默认功能的情况下创建RCP项目?

Each time I create Eclipse RCP project, it runs in separate workspace, shows Package Explorer at left, allows to create projects and so on. 每次我创建Eclipse RCP项目时,它都在单独的工作区中运行,在左侧显示Package Explorer,允许创建项目等等。

Is it possible to create standalone applications like XMind, which just open files of certain types and contain views of certain types? 是否可以创建独立的应用程序(如XMind),它们仅打开某些类型的文件并包含某些类型的视图?

UPDATE UPDATE

For example, there is a Zest sample just inside Eclipse help. 例如,Eclipse帮助中就有一个Zest示例。 It is intended to run under Eclipse, but contains main: 它旨在在Eclipse下运行,但主要包含以下内容:

/*******************************************************************************
  * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
  * Canada. 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: The Chisel Group, University of Victoria
  ******************************************************************************/
 package org.eclipse.zest.examples.swt;

 import org.eclipse.zest.core.widgets.Graph;
 import org.eclipse.zest.core.widgets.GraphConnection;
 import org.eclipse.zest.core.widgets.GraphNode;
 import org.eclipse.zest.layouts.LayoutStyles;
 import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;

 /**
  * This snippet creates a very simple graph where Rock is connected to Paper
  * which is connected to scissors which is connected to rock.
  * 
  * The nodes a layed out using a SpringLayout Algorithm, and they can be moved
  * around.
  * 
  * 
  * @author Ian Bull
  * 
  */
 public class GraphSnippet1 {
    /**
     * @param args
     */
    public static void main(String[] args) {
        // Create the shell
        Display d = new Display();
        Shell shell = new Shell(d);
        shell.setText("GraphSnippet1");
        shell.setLayout(new FillLayout());
        shell.setSize(400, 400);

        Graph g = new Graph(shell, SWT.NONE);
        GraphNode n = new GraphNode(g, SWT.NONE, "Paper");
        GraphNode n2 = new GraphNode(g, SWT.NONE, "Rock");
        GraphNode n3 = new GraphNode(g, SWT.NONE, "Scissors");
        new GraphConnection(g, SWT.NONE, n, n2);
        new GraphConnection(g, SWT.NONE, n2, n3);
        new GraphConnection(g, SWT.NONE, n3, n);
        g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);

        shell.open();
        while (!shell.isDisposed()) {
            while (!d.readAndDispatch()) {
                d.sleep();
            }
        }
    }
 }

How to compile this? 如何编译呢? If I put it just into java project, it does not have numerous Eclipse libs. 如果仅将其放入Java项目中,则其中没有许多Eclipse库。 But if I create plugin project, I see no place to insert main method. 但是,如果我创建插件项目,则看不到插入main方法的地方。

To get the absolute minimum RCP code do File / New Project and select Plug-in Project . 要获取绝对最小的RCP代码,请执行File / New Project然后选择Plug-in Project On the second step of the wizard deselect This plug-in will make contributions to the UI and select Yes for Would you like to create a 3.x rich client application . 在向导的第二步中,取消选择“ This plug-in will make contributions to the UI并为Would you like to create a 3.x rich client application选择“ Yes Would you like to create a 3.x rich client application The final step of the wizard will then have a Headless Hello RCP which creates the absolute minimum code for a RCP. 然后,向导的最后一步将有一个Headless Hello RCP ,它为Headless Hello RCP创建绝对的最小代码。

If you leave This plug-in will make contributions to the UI checked some templates to create RCPs with a view etc. are shown. 如果您离开This plug-in will make contributions to the UI选中This plug-in will make contributions to the UI了一些用于创建带有视图等的RCP的模板。

The above is for Eclipse 3.x style RCPs, for Eclipse 4 pure e4 RCPs use Eclipse 4 / Eclipse 4 Application Project in New Project wizard. 以上是针对Eclipse 3.x样式的RCP,对于Eclipse 4纯e4 RCP,请在“新建项目”向导中使用Eclipse 4 / Eclipse 4 Application Project

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM