How to make Content assist working when editors are inside Composite? [message #905087] |
Wed, 29 August 2012 16:52 |
cyriel cysiek Messages: 4 Registered: August 2012 |
Junior Member |
|
|
Hi,
i've got problem with content assistant. In MultiPageEditor on one tab i've got 2 StructuredTextEditor in one Composite:
MultiPageEditor:
-page0:
--composite: StructuredTextEditor1, StructuredTextEditor2
When StructuredTextEditor are on 2 different pages everything is fine, but when they are on the same page content assist is not working(ctrl+space == no effect). I think(but i'm not sure) that for some reason Composite is not sending events(information that ctrl+space has been pressed) to its children, but i have no idea why... How can i fix that(am i missing something?)?
I'm trying to do that using this code:
void createPage0() {
Composite composite = new Composite(getContainer(), SWT.NONE);
GridLayout layout = new GridLayout (1, true);
composite.setLayout(layout);
StructuredTextEditor logicInputEditor = new StructuredTextEditor();
IEditorSite site = createSite(logicInputEditor);
try {
logicInputEditor.init(site, getEditorInput());
} catch (PartInitException e) {
e.printStackTrace();
}
logicInputEditor.createPartControl(this.getContainer());
StructuredTextEditor logicOutputEditor = new StructuredTextEditor();
site = createSite(logicOutputEditor);
try {
logicOutputEditor.init(site, createFileEditorInputForFile(projectFullPath, projectPath, "out.html"));
} catch (PartInitException e) {
e.printStackTrace();
}
logicOutputEditor.createPartControl(composite);
Control[] children = composite.getChildren();
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
children[ 0 ].setLayoutData(gd);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
children[ 1 ].setLayoutData(gd);
int index = addPage(composite);
setPageText(index, "Logic");
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02695 seconds