2016-09-29 10 views
0

RCP가 아닌 Eclipse 플러그인을 개발 중이며 Jface와 SWT를 사용하여 사용자 인터페이스를 작성하고 있습니다. 사실은 사용자 인터페이스를 쉽게 개발할 수 있도록 WindowBuilder 플러그인을 다운로드했으며 사용자 정의 TitleAreaDialog를 만들었습니다.Eclipse 플러그인에서 SWT/JFace TitleAreaDialog의 변경 사항을 볼 수없는 이유는 무엇입니까?

이 시점까지 모든 항목이 정상적으로 실행되며 WindowBuilder (상단 이미지)에서 다음 TitleAreaDialog를 볼 수 있으며 이클립스 플러그인을 실행하려고하면 문제가 발생합니다. 나무와 왼쪽 측면의 요소가 사라 키우면 :

WindowBuilder (top) and Plugin executed (bottom)

은 아무도 무슨 일이 일어나고 있는지 알고 있나요? plugin.xml 또는 MANIFEST.MF에 무언가를 추가해야합니까?

감사합니다.

EDIT : zip에는 plugin.xml, MANIFEST.XML, build.properties, Handler 및 gui라는 PlugiGUI가 있습니다. 궁금한 점이 있으면 부탁드립니다.

감사합니다.

/** 
* Create contents of the dialog. 
* @param parent 
*/ 
@Override 
protected Control createDialogArea(Composite parent) { 
    //TITLE AND IMAGE OF TitleDialog 
       ... 

    //Composite   
    Composite area = (Composite) super.createDialogArea(parent); 
    Composite container = new Composite(area, SWT.NONE); 
    container.setLayout(new FillLayout(SWT.HORIZONTAL)); 
    container.setLayoutData(new GridData(GridData.FILL_BOTH)); 

    //Creates the division 
    SashForm sashForm = new SashForm(container, SWT.NONE); 


    //Right division 
    Group rightGroup = new Group(sashForm, SWT.NONE); 
    rightGroup.setLayout(new StackLayout()); 

    //Create the tree 
    Tree tree = new Tree(rightGroup, SWT.BORDER); 
    tree.setLinesVisible(true); 
    tree.setToolTipText(""); 
    tree.setHeaderVisible(true); 

    //Create tree elements 
    TreeItem pluginProperties = new TreeItem(tree, SWT.NONE); 
    pluginProperties.setText("Plugin properties"); 
    pluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoProperties.png")); 


    TreeItem createPluginProperties = new TreeItem(pluginProperties, SWT.NONE); 
    createPluginProperties.setText("Create"); 
    createPluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoPlus.png")); 
    TreeItem editPluginProperties = new TreeItem(pluginProperties, SWT.NONE); 
    editPluginProperties.setText("Edit/Delete"); 
    editPluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoRemoveEdit.png")); 
    pluginProperties.setExpanded(true); 

    //MORE TREE ELEMENTS WITH SAME PATTERN 
    .............. 

    //Left division 
    Group leftGroup = new Group(sashForm, SWT.NONE); 
    leftGroup.setLayout(new StackLayout()); 

    Composite projectConfigDescriptor = new Composite(leftGroup, SWT.NONE); 

    //Proportion of sashForm 
    sashForm.setWeights(new int[] {220, 469}); 
    return area; 
} 

가 왜 WindowBuilder을 수행

You can download the code here.

편집 2 : 다음 MANIFEST.MF 코드의 부분이 TitleAreaDialog 코드의 다음

Bundle-SymbolicName: org.eclipse.plugin.arturito;singleton:=true 
Require-Bundle: org.eclipse.ui, 
org.eclipse.core.runtime 
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 
Bundle-ActivationPolicy: lazy 
Bundle-ClassPath: ., 
swing2swt.jar 

일부입니다 TitleDialog를 보여주고 싶습니다. 내 플러그인은 원하지 않습니까?

+1

코드를 표시해야합니다. –

+0

코드가 추가되었습니다. Run Configurations와 같은 TitleAreaDialog를 생성해야하지만, 볼 수있는 것처럼 작동하지 않는지는 알지 못합니다. – Jaime

+0

코드가 반드시 있어야합니다. 스택 오버플로에 대한 질문은 링크 된 코드가 어느 시점에서 삭제되면 문제가 쓸모 없게되는 경우 다른 사람뿐만 아니라 여러분을 도우려는 것입니다. 우리에게 [mcve] (최소한 TitleAreaDialog)를 보여주십시오. –

답변

0

왼쪽 및 오른쪽 그룹의 레이아웃은 StackLayout으로 설정되어 있습니다. 이 레이아웃에서는 현재 표시 할 컨트롤의 최상위 컨트롤을 지정해야합니다. 그래서 당신은 할 것 :

StackLayout layout = new StackLayout(); 
rightGroup.setLayout(layout); 

... create Tree 

layout.topControl = tree; 

을 그러나 당신이 각 측면에 하나의 최고 레벨 컨트롤을 만드는으로 StackLayout을 사용할 필요는 없다 의미한다. 따라서 사용하실 수 있습니다 FillLayout :

+0

그것은 일했다! 고마워요! – Jaime