break; case 4: htmlPreviewEditor = new HtmlPreviewEditor(); editorPart = htmlPreviewEditor; try { this.addPage(editorPart, editorInput[i - 3]); } catch (PartInitException e) { ComponenteditorPlugin.getDefault().log(e); } this.setPageText(i - 1, "Preview");
	protected void createPages() {		IEditorInput[] editorInput = componentEditorInput.getInput();		editorParts = new IEditorPart[editorInput.length + 1];		Composite componentEditorParent = new Composite(getContainer(),				SWT.NONE);		componentEditorParent.setLayout(new FillLayout());		SashForm componentEditorSashParent = new SashForm(				componentEditorParent, SWT.VERTICAL | SWT.SMOOTH);		SashForm htmlSashform = new SashForm(componentEditorSashParent,				SWT.VERTICAL);		htmlSashform.addListener(SWT.Activate, new Listener() {			public void handleEvent(Event event) {				htmlActive = true;				pageChange(1);				ComponentEditorPart.this.updateOutline();			}		});		SashForm wodSashform = new SashForm(componentEditorSashParent,				SWT.VERTICAL);		wodSashform.addListener(SWT.Activate, new Listener() {			public void handleEvent(Event event) {				htmlActive = false;				pageChange(1);				ComponentEditorPart.this.updateOutline();			}		});		for (int i = 0; i < componentEditorInput.getEditors().length + 1; i++) {			IEditorPart editorPart = null;			switch (i) {			case 0:				compilationUnitEditor = new CompilationUnitEditor() {					public Object getAdapter(Class adapter) {						if (adapter.equals(IGotoMarker.class)) {							return super.getAdapter(adapter);						}						return super.getAdapter(adapter);					}					public void gotoMarker(IMarker marker) {						super.gotoMarker(marker);					}				};				editorPart = compilationUnitEditor;				try {					this.addPage(editorPart, editorInput[i]);				} catch (PartInitException e) {					ComponenteditorPlugin.getDefault().log(e);				}				this.setPageText(i, "Java");				break;			case 1:				structuredTextEditorHTMLWithWebObjectTags = new StructuredTextEditorHTMLWithWebObjectTags();				editorPart = structuredTextEditorHTMLWithWebObjectTags;				IEditorSite htmlSite = createSite(editorPart);				try {					editorPart.init(htmlSite, editorInput[i]);				} catch (PartInitException e) {					ComponenteditorPlugin.getDefault().log(e);				}				createInnerPartControl(htmlSashform, editorPart);				editorPart.addPropertyListener(new IPropertyListener() {					public void propertyChanged(Object source, int propertyId) {						ComponentEditorPart.this								.handlePropertyChange(propertyId);					}				});				break;			case 2:				wodEditor = new WodEditor();				editorPart = wodEditor;				IEditorSite wodSite = createSite(editorPart);				try {					editorPart.init(wodSite, editorInput[i]);				} catch (PartInitException e) {					ComponenteditorPlugin.getDefault().log(e);				}				createInnerPartControl(wodSashform, editorPart);				editorPart.addPropertyListener(new IPropertyListener() {					public void propertyChanged(Object source, int propertyId) {						ComponentEditorPart.this								.handlePropertyChange(propertyId);					}				});				this.addPage(componentEditorParent);				this.setPageText(i - 1, "Component");				wodEditor.getSelectionProvider().addSelectionChangedListener(						new ISelectionChangedListener() {							public void selectionChanged(									SelectionChangedEvent event) {								WodclipsePlugin.getDefault()										.updateWebObjectsTagNames(null);							}						});				WodclipsePlugin.getDefault()						.updateWebObjectsTagNames(wodEditor);				break;			case 3:				apiEditor = new ApiEditor();				editorPart = apiEditor;				try {					this.addPage(editorPart, editorInput[i]);				} catch (PartInitException e) {					ComponenteditorPlugin.getDefault().log(e);				}				this.setPageText(i - 1, "Api");				break;			case 4:				htmlPreviewEditor = new HtmlPreviewEditor();				editorPart = htmlPreviewEditor;				try {					this.addPage(editorPart, editorInput[i - 3]);				} catch (PartInitException e) {					ComponenteditorPlugin.getDefault().log(e);				}				this.setPageText(i - 1, "Preview");				break;			default:				break;			}			editorParts[i] = editorPart;			if(editorPart instanceof IEmbeddedEditor) {				IEmbeddedEditor embeddedEditor = (IEmbeddedEditor)editorPart;				embeddedEditor.initEditorInteraction(editorInteraction);			}		}				addWebObjectsTagNamesListener();				CTabFolder tabFolder = (CTabFolder) this.getContainer();		tabFolder.addSelectionListener(new SelectionListener() {			public void widgetSelected(SelectionEvent e) {				ComponentEditorPart.this.updateOutline();			}			public void widgetDefaultSelected(SelectionEvent e) {				return;			}		});		if (componentEditorInput.isDisplayJavaPartOnReveal()) {			Display.getDefault().asyncExec(new Runnable() {				public void run() {					ComponentEditorPart.this.updateOutline();				}			});		}		if (componentEditorInput.isDisplayHtmlPartOnReveal()) {			this.switchToHtml();		} else if (componentEditorInput.isDisplayWodPartOnReveal()) {			this.switchToWod();		} else if (componentEditorInput.isDisplayWooPartOnReveal()) {			this.switchToWod();		} else if (componentEditorInput.isDisplayApiPartOnReveal()) {			this.switchToApi();		}		return;	}