diff options
author | hyukmin kwon <hyukmin0530.kwon@samsung.com> | 2012-10-29 22:38:12 +0900 |
---|---|---|
committer | hyukmin kwon <hyukmin0530.kwon@samsung.com> | 2012-10-29 22:38:12 +0900 |
commit | da4c533c68915f1e2081a6d1ab4a40a2f27ac0ee (patch) | |
tree | 2367e5e96c3c69123aa87cdbb279421fcfa91a0b | |
parent | e83fc31dc2d08c20de25181b57555f9b189f01ac (diff) | |
download | jsdt-extension-eplugin-da4c533c68915f1e2081a6d1ab4a40a2f27ac0ee.tar.gz jsdt-extension-eplugin-da4c533c68915f1e2081a6d1ab4a40a2f27ac0ee.tar.bz2 jsdt-extension-eplugin-da4c533c68915f1e2081a6d1ab4a40a2f27ac0ee.zip |
[Title] Advanced Declaration View: Display of the number of JavaScript
elements is added. Some UI relocation is applied.
[Desc.] Display of the number of JavaScript elements is added. Two
information labels are added. ComboViewer is moved to top. Element
information
is moved to bottom.
[Issue] REDMINE-7327
-rw-r--r-- | org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java b/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java index 2ef8b35..d7e036e 100644 --- a/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java +++ b/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java @@ -55,6 +55,7 @@ import org.eclipse.swt.layout.FormLayout; 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.swt.widgets.Shell; import org.eclipse.ui.IActionBars; @@ -150,6 +151,11 @@ public class AdvancedDeclarationView extends ViewPart implements ISelectionListe private ComboViewer fComboViewer; /** The viewers configuration */ private JavaScriptSourceViewerConfiguration fViewerConfiguration; + /** This view's javascript element info label */ + private Label fElementInfoLabel; + /** This view's result info label */ + private Label fResultInfoLabel; + /** The viewer's font properties change listener. */ private IPropertyChangeListener fFontPropertyChangeListener= new FontPropertyChangeListener(); /** The current input. */ @@ -565,6 +571,12 @@ public class AdvancedDeclarationView extends ViewPart implements ISelectionListe } }); + fElementInfoLabel = new Label(parent, SWT.LEFT); + fElementInfoLabel.setText(""); + + fResultInfoLabel = new Label(parent, SWT.LEFT); + fResultInfoLabel.setText(""); + fSrcViewer = new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL, store); fViewerConfiguration= new SimpleJavaSourceViewerConfiguration(JavaScriptPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, IJavaScriptPartitions.JAVA_PARTITIONING, false); fSrcViewer.configure(fViewerConfiguration); @@ -576,17 +588,29 @@ public class AdvancedDeclarationView extends ViewPart implements ISelectionListe store.addPropertyChangeListener(fPropertyChangeListener); getViewSite().setSelectionProvider(fSrcViewer); - formData = new FormData(); - formData.right = new FormAttachment(100,-margin); - formData.bottom = new FormAttachment(100,-margin); - formData.left = new FormAttachment(0,margin); - fComboViewer.getCombo().setLayoutData(formData); + formData = new FormData(); + formData.left = new FormAttachment(0, margin); + formData.right = new FormAttachment(70, -2 * margin); + formData.top = new FormAttachment(0, margin); + fComboViewer.getControl().setLayoutData(formData); + formData = new FormData(); + formData.left = new FormAttachment(fComboViewer.getControl(), 2 * margin); + formData.right = new FormAttachment(100, -margin); + formData.top = new FormAttachment(0, margin); + fResultInfoLabel.setLayoutData(formData); + + formData = new FormData(); + formData.left = new FormAttachment(0, margin); + formData.right = new FormAttachment(100, -margin); + formData.bottom = new FormAttachment(100, -margin); + fElementInfoLabel.setLayoutData(formData); + formData = new FormData(); - formData.right = new FormAttachment(100,-margin); - formData.top = new FormAttachment(0,margin); - formData.left = new FormAttachment(0,margin); - formData.bottom = new FormAttachment(fComboViewer.getControl(),-margin); + formData.left = new FormAttachment(0, margin); + formData.right = new FormAttachment(100, -margin); + formData.top = new FormAttachment(fComboViewer.getControl(), margin); + formData.bottom = new FormAttachment(fElementInfoLabel, -margin); fSrcViewer.getControl().setLayoutData(formData); } @@ -1010,9 +1034,15 @@ public class AdvancedDeclarationView extends ViewPart implements ISelectionListe return; if (jsElements != null && jsElements.length > 0) { + if (jsElements.length == 1) { + fResultInfoLabel.setText(jsElements.length + " case"); + } else { + fResultInfoLabel.setText(jsElements.length + " cases"); + } updateComboViewer(jsElements); } else { - setContentDescription("No declarations found"); + fElementInfoLabel.setText("No declarations found"); + fResultInfoLabel.setText("0 case"); updateComboViewer(new IJavaScriptElement[] {}); } } @@ -1050,7 +1080,7 @@ public class AdvancedDeclarationView extends ViewPart implements ISelectionListe else flags= TITLE_FLAGS; - setContentDescription(jsFileName + " - " + JavaScriptElementLabels.getElementLabel(inputElement, flags) ); + fElementInfoLabel.setText(JavaScriptElementLabels.getElementLabel(inputElement, flags) + " ...(in " + jsFileName + ")"); setTitleToolTip(JavaScriptElementLabels.getElementLabel(inputElement, TOOLTIP_LABEL_FLAGS)); } |