diff options
author | hyukmin kwon <hyukmin0530.kwon@samsung.com> | 2013-05-31 17:04:17 +0900 |
---|---|---|
committer | hyukmin kwon <hyukmin0530.kwon@samsung.com> | 2013-05-31 17:04:17 +0900 |
commit | f584514e733781a6c616cef924193c45fcf7e527 (patch) | |
tree | fc6f900864aa347f2e075bf39eecfd63624ee370 | |
parent | b4e0ef083350ababd87bad3578fda5679c7d56da (diff) | |
download | jsdt-extension-eplugin-f584514e733781a6c616cef924193c45fcf7e527.tar.gz jsdt-extension-eplugin-f584514e733781a6c616cef924193c45fcf7e527.tar.bz2 jsdt-extension-eplugin-f584514e733781a6c616cef924193c45fcf7e527.zip |
[Title] Advanced Declaration View for HTML Editor
[Desc.] Tag TagHierarchy function is removed.
[Issue] REDMINE-9503
Change-Id: I6d37276dba16fafaf8583261ab1d21b5f7d09f5b
-rw-r--r-- | org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/HTMLDeclarationPage.java | 134 |
1 files changed, 6 insertions, 128 deletions
diff --git a/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/HTMLDeclarationPage.java b/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/HTMLDeclarationPage.java index 1c44618..4a5c8f2 100644 --- a/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/HTMLDeclarationPage.java +++ b/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/HTMLDeclarationPage.java @@ -47,8 +47,6 @@ import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; @@ -57,18 +55,15 @@ import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Menu; import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorPart; import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.IViewSite; import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; @@ -115,7 +110,6 @@ import org.eclipse.wst.xml.core.internal.document.NodeImpl; import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument; import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin; -import org.w3c.dom.Node; import org.w3c.dom.stylesheets.StyleSheet; import org.w3c.dom.stylesheets.StyleSheetList; @@ -138,12 +132,11 @@ IMenuListener, IPropertyChangeListener{ private static final int MODE_JS_DECLARATION = 0; private static final int MODE_JS_DECLARATION_HTML = 1; private static final int MODE_CSS_DECLARATION = 2; - private static final int MODE_TAG_HIERARCHY = 3; - private static final int MODE_IMAGE_VIEW = 4; - private static final int MODE_JS_FILE_VIEW = 5; - private static final int MODE_CSS_FILE_VIEW = 6; - private static final int MODE_INVALID_CASE = 7; - private static final int NUMBER_OF_MODES = 8; + private static final int MODE_IMAGE_VIEW = 3; + private static final int MODE_JS_FILE_VIEW = 4; + private static final int MODE_CSS_FILE_VIEW = 5; + private static final int MODE_INVALID_CASE = 6; + private static final int NUMBER_OF_MODES = 7; private int mode = MODE_JS_DECLARATION; @@ -184,9 +177,6 @@ IMenuListener, IPropertyChangeListener{ private ISelectionChangedListener fComboViewerSelectionChangedListener; - /** Tag Hierarchy buttons **/ - private Button[] fTagButtons; - /** No contents displaying label */ private Label fNoContentsLabels[]; @@ -305,8 +295,6 @@ IMenuListener, IPropertyChangeListener{ break; case MODE_CSS_DECLARATION: break; - case MODE_TAG_HIERARCHY: - break; case MODE_IMAGE_VIEW: break; case MODE_JS_FILE_VIEW: @@ -419,7 +407,6 @@ IMenuListener, IPropertyChangeListener{ fNoContentsLabels[MODE_JS_DECLARATION].setText("No JavaScript delcarations"); fNoContentsLabels[MODE_JS_DECLARATION_HTML].setText("No JavaScript delcarations"); fNoContentsLabels[MODE_CSS_DECLARATION].setText("No CSS contents"); - fNoContentsLabels[MODE_TAG_HIERARCHY].setText("No JavaScript contents"); fNoContentsLabels[MODE_IMAGE_VIEW].setText("No image file"); fNoContentsLabels[MODE_JS_FILE_VIEW].setText("No JavaScript file"); fNoContentsLabels[MODE_CSS_FILE_VIEW].setText("No CSS file"); @@ -447,9 +434,6 @@ IMenuListener, IPropertyChangeListener{ case MODE_CSS_DECLARATION: viewerConfiguration = createCSSTextViewerConfiguration(); break; - case MODE_TAG_HIERARCHY: - viewerConfiguration = createHTMLTextViewerConfiguration(); - break; case MODE_IMAGE_VIEW: break; case MODE_JS_FILE_VIEW: @@ -516,9 +500,6 @@ IMenuListener, IPropertyChangeListener{ case MODE_CSS_DECLARATION: viewer = createCSSViewer(parent, verticalRuler, viewerConfiguration); break; - case MODE_TAG_HIERARCHY: - viewer = createHTMLViewer(parent, verticalRuler, viewerConfiguration); - break; case MODE_IMAGE_VIEW: break; case MODE_JS_FILE_VIEW: @@ -568,10 +549,6 @@ IMenuListener, IPropertyChangeListener{ fComboViewer.getCombo().removeAll(); fNumberOfComboViewerItems = 0; break; - case MODE_TAG_HIERARCHY: - fComboViewer.getCombo().removeAll(); - fNumberOfComboViewerItems = 0; - break; case MODE_IMAGE_VIEW: fComboViewer.getCombo().removeAll(); fNumberOfComboViewerItems = 0; @@ -607,8 +584,6 @@ IMenuListener, IPropertyChangeListener{ break; case MODE_CSS_DECLARATION: break; - case MODE_TAG_HIERARCHY: - break; case MODE_IMAGE_VIEW: break; case MODE_JS_FILE_VIEW: @@ -869,8 +844,6 @@ IMenuListener, IPropertyChangeListener{ mode = MODE_INVALID_CASE; } - } else if (element instanceof org.eclipse.wst.xml.core.internal.document.ElementImpl) { - mode = MODE_TAG_HIERARCHY; } else { mode = MODE_INVALID_CASE; } @@ -899,9 +872,6 @@ IMenuListener, IPropertyChangeListener{ case MODE_CSS_DECLARATION: displayCSS(); break; - case MODE_TAG_HIERARCHY: - displayTagHierarchy(); - break; case MODE_IMAGE_VIEW: displayImage(); break; @@ -1243,8 +1213,6 @@ IMenuListener, IPropertyChangeListener{ break; case MODE_CSS_DECLARATION: break; - case MODE_TAG_HIERARCHY: - break; case MODE_IMAGE_VIEW: break; case MODE_JS_FILE_VIEW: @@ -1367,71 +1335,6 @@ IMenuListener, IPropertyChangeListener{ } } - private void displayTagHierarchy() { - Node node = fSelectedNode; - ArrayList <ElementImpl> tagHierarchyList = new ArrayList<ElementImpl>(); - - while (node instanceof ElementImpl) { - // collect tag hierarchy - tagHierarchyList.add((ElementImpl) node); - node = node.getParentNode(); - } - - if (tagHierarchyList.size() == 0) { - tagHierarchyList = null; - return; - } - - if (fTagButtons != null) { - // dispose all buttons to disappear - for (Button button : fTagButtons) { - button.dispose(); - } - } - - int tagHierarchyListSize = tagHierarchyList.size(); - fTagButtons = new Button[tagHierarchyListSize]; - - for (int index = 0; index < tagHierarchyListSize; index++) { - ElementImpl element = tagHierarchyList.get(index); - String tagName = element.getTagName(); - fTagButtons[index] = new Button(subComposites[MODE_TAG_HIERARCHY], SWT.TOGGLE); - fTagButtons[index].setText("<"+tagName+">"); - - fTagButtons[index].setData(element); - fTagButtons[index].addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - // get selected button data - Button button = (Button) e.getSource(); - ElementImpl element = (ElementImpl) button.getData(); - - IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); - IStructuredDocument doc = ((org.eclipse.wst.sse.ui.StructuredTextEditor) part).getModel().getStructuredDocument(); - int tagStartOffset = element.getStartOffset(); - int lineOfOffset = doc.getLineOfOffset(tagStartOffset); - String source = ""; - try { - int lineOffset = doc.getLineOffset(lineOfOffset); - int whitespaceLength = tagStartOffset - lineOffset; - int elementLength = element.getEndOffset() - tagStartOffset; - source = doc.get(lineOffset, whitespaceLength + elementLength); - } catch (BadLocationException e1) { - source = ""; - } - - fSrcViewer.getDocument().set(source); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - } - - updateLayout(false); - } - /** * Sets the font for this viewer sustaining selection and scroll position. */ @@ -1553,26 +1456,6 @@ IMenuListener, IPropertyChangeListener{ fSrcViewer.getControl().setLayoutData(formData); } break; - case MODE_TAG_HIERARCHY: - if (fSrcViewer != null) { - formData = new FormData(); - formData.left = new FormAttachment(0, margin); - formData.right = new FormAttachment(100, -margin); - if (fTagButtons != null && fTagButtons.length >= 1) { - formData.top = new FormAttachment(fTagButtons[fTagButtons.length-1], margin); - } - formData.bottom = new FormAttachment(100, -margin); - fSrcViewer.getControl().setLayoutData(formData); - - if (fTagButtons != null) { - for (int index = fTagButtons.length - 2; index >= 0; index--) { - formData = new FormData(); - formData.left = new FormAttachment(fTagButtons[index + 1], margin); - fTagButtons[index].setLayoutData(formData); - } - } - } - break; case MODE_IMAGE_VIEW: break; case MODE_JS_FILE_VIEW: @@ -1780,12 +1663,7 @@ IMenuListener, IPropertyChangeListener{ fBackgroundColor.dispose(); fBackgroundColor= null; } - if (fTagButtons != null) { - for (Button button : fTagButtons) { - button.dispose(); - } - fTagButtons = null; - } + fFoundCSSList = null; internalDispose(); |