From: jooyoul_lee Date: Mon, 28 Apr 2014 12:33:39 +0000 (+0900) Subject: DESIGNER : refactoriing EditPart and PartFigure X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d44638093505c9826df59684e3da5ec7b28fca4;p=sdk%2Fide%2Fweb-ui-builder-eplugin.git DESIGNER : refactoriing EditPart and PartFigure DataBinding codes move to lower class 1. HoverBrowserViewer -> DesignerBrowserViewer 2. PartFigure -> WidgetFigure 3. HoverViewerEditPart -> DesignerEditPart Change-Id: I223bfe2f6401a0d909d584c073d18a76136ba8e0 Signed-off-by: jooyoul_lee --- diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ShowDataBindingCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ShowDataBindingCommand.java deleted file mode 100644 index 29657c4..0000000 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ShowDataBindingCommand.java +++ /dev/null @@ -1,59 +0,0 @@ - - -package org.tizen.webuibuilder.gef.commands; - -import org.eclipse.gef.commands.Command; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.tizen.webuibuilder.ui.editor.PageDesigner; -import org.tizen.webuibuilder.ui.editor.PageDesignerForHTML; - - -public class ShowDataBindingCommand extends Command { - private boolean show; - - public ShowDataBindingCommand(String propertyName, String propertyValue, boolean show) { - this.show = show; - } - - @Override - public void execute() { - PageDesigner pageDesigner = getActivePageDesigner(); - pageDesigner.showBindingInfo(show); - } - - private PageDesigner getActivePageDesigner() { - if (getWorkbenchWindow() == null) { - return null; - } - - IWorkbenchPage activePage = getWorkbenchWindow().getActivePage(); - if (activePage == null) { - IWorkbenchPage[] pages = getWorkbenchWindow().getPages(); - if (pages.length > 0) { - IEditorPart[] editors = pages[0].getEditors(); - for (int i = 0; i < editors.length; i++) { - if (editors[i] instanceof PageDesigner) { - return (PageDesigner) editors[i]; - } - } - } - } else { - IEditorPart activeEditor = activePage.getActiveEditor(); - if (activeEditor instanceof PageDesigner || activeEditor instanceof PageDesignerForHTML) { - return (PageDesigner) activeEditor; - } - } - return null; - } - - private IWorkbenchWindow getWorkbenchWindow() { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - - return workbenchWindow; - } -} diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerEditPart.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerEditPart.java index 1b2d4a8..e6efdcb 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerEditPart.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerEditPart.java @@ -35,6 +35,7 @@ import org.eclipse.gef.SnapToGrid; import org.eclipse.gef.SnapToGuides; import org.eclipse.gef.SnapToHelper; import org.eclipse.gef.rulers.RulerProvider; +import org.tizen.webuibuilder.gef.figure.WidgetFigure; import org.tizen.webuibuilder.gef.policies.DesignerAbsoluteDragEditPolicy; import org.tizen.webuibuilder.gef.policies.DesignerDragEditPolicy; import org.tizen.webuibuilder.gef.policies.DesignerSelectionEditPolicy; @@ -123,4 +124,30 @@ public class DesignerEditPart extends HoverViewerEditPart { return super.getAdapter(key); } + @Override + protected void refreshVisuals() { + super.refreshVisuals(); + + if (!(getFigure() instanceof WidgetFigure) + || (!(getViewer() instanceof DesignerBrowserViewer))) { + return; + } + + WidgetFigure figure = (WidgetFigure) getFigure(); + Part model = ((Part) getModel()); + + // check data binding info + String dataBinding = model.getPropertyValue("data-bind"); + + boolean binded; + + DesignerBrowserViewer viewer = (DesignerBrowserViewer) getViewer(); + binded = viewer.isShowBindingInfo(); + + if (null != dataBinding && !dataBinding.isEmpty() && binded) { + figure.setBinded(true); + } else { + figure.setBinded(false); + } + } } \ No newline at end of file diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerRootEditPart.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerRootEditPart.java index aa04304..9d46dd6 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerRootEditPart.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerRootEditPart.java @@ -42,4 +42,7 @@ public class DesignerRootEditPart extends HoverViewerRootEditPart { installEditPolicy(EditPolicy.LAYOUT_ROLE, new DesignerXYLayoutEditPolicy()); } + public void updateBindingInfo(boolean isBinded) { + getFigure().invalidate(); + } } diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerEditPart.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerEditPart.java index 03cc71f..1c3039f 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerEditPart.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerEditPart.java @@ -54,8 +54,6 @@ import org.tizen.webuibuilder.model.Part; import org.tizen.webuibuilder.model.PartEvent; import org.tizen.webuibuilder.model.css.CssEvent; import org.tizen.webuibuilder.model.css.ICssListener; -import org.tizen.webuibuilder.ui.editor.PageDesigner; -import org.tizen.webuibuilder.ui.editor.PageDesignerUtil; import org.tizen.webuibuilder.ui.editor.ruler.DesignerGuide; @@ -167,24 +165,6 @@ public class HoverViewerEditPart extends AbstractGraphicalEditPart implements IP figure.setLayout(new Rectangle(0, 0, 0, 0)); } figure.setBorder(model.canBeVisibleBorder()); - - // check data binding info - String dataBinding = model.getPropertyValue("data-bind"); - - boolean binded; - PageDesigner pageDesigner = PageDesignerUtil.getActivePageDesigner(); - if (null != pageDesigner) { - binded = pageDesigner.isShowBindingInfo(); - } else { - binded = false; - } - - if (null != dataBinding && !dataBinding.isEmpty() && binded) { - figure.setBinded(true); - } else { - figure.setBinded(false); - } - } @Override diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerRootEditPart.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerRootEditPart.java index dc4c7be..7dd7cb7 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerRootEditPart.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerRootEditPart.java @@ -117,10 +117,6 @@ public class HoverViewerRootEditPart extends ScalableFreeformRootEditPart { getFigure().invalidate(); } - public void updateBindingInfo(boolean isBinded) { - getFigure().invalidate(); - } - public void updateScrollBar() { Layer virtualLayer = (Layer) getLayer(VIRTUAL_SCREEN_LAYER); virtualLayer.invalidate(); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/PartFigure.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/PartFigure.java index 9df4f37..8cdaf98 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/PartFigure.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/PartFigure.java @@ -86,38 +86,12 @@ public class PartFigure extends Figure { return rc; } - // 2014 04 21 - tooltip added by casval public PartFigure() { layout = new XYLayout(); setLayoutManager(layout); setForegroundColor(ColorConstants.blue); setBorder(new LineBorder(2)); - - tooltipFigure = new TooltipFigure(); - setToolTip(null); - - } - - // 2014/04/21 binded added by casval - public void setBinded(boolean binded) { - this.bBinded = binded; - } - - public boolean isBinded() { - return bBinded; - } - - public void setDataBindTooltipText(String tooltip) { - tooltipFigure.setMessage(tooltip); - } - - public void setTooltipEnabled(boolean enabled) { - if (enabled) { - setToolTip(tooltipFigure); - } else { - setToolTip(null); - } } public void setLayout(Rectangle rect) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/WidgetFigure.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/WidgetFigure.java index bc66409..def69d5 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/WidgetFigure.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/WidgetFigure.java @@ -36,14 +36,41 @@ import org.tizen.webuibuilder.utility.ResourceManager; public class WidgetFigure extends PartFigure implements MouseMotionListener { + private TooltipFigure tooltipFigure = null; + private boolean bBinded = false; + public WidgetFigure() { super(); setBackgroundColor(ColorConstants.blue); setOpaque(false); addMouseMotionListener(this); + + tooltipFigure = new TooltipFigure(); + setToolTip(null); + } + + // 2014/04/21 binded added by casval + public void setBinded(boolean binded) { + this.bBinded = binded; + } + + public boolean isBinded() { + return bBinded; } + public void setDataBindTooltipText(String tooltip) { + tooltipFigure.setMessage(tooltip); + } + + public void setTooltipEnabled(boolean enabled) { + if (enabled) { + setToolTip(tooltipFigure); + } else { + setToolTip(null); + } + } + @Override public boolean containsPoint(int x, int y) { if (containtsInChidren(this, x, y)) { @@ -92,7 +119,7 @@ public class WidgetFigure extends PartFigure implements MouseMotionListener { } } - //data binding icon check + // data binding icon check if (isBinded()) { Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "binded.gif"); if (null == img) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/DesignerBrowserViewer.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/DesignerBrowserViewer.java index 8ac419a..5c7f637 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/DesignerBrowserViewer.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/DesignerBrowserViewer.java @@ -23,6 +23,8 @@ package org.tizen.webuibuilder.gef.viewer; +import java.util.List; + import org.eclipse.gef.EditPartViewer; import org.eclipse.gef.dnd.TemplateTransfer; import org.eclipse.swt.dnd.DND; @@ -32,6 +34,10 @@ import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.ui.IEditorInput; import org.tizen.webuibuilder.gef.editparts.DesignerRootEditPart; +import org.tizen.webuibuilder.gef.editparts.HoverViewerEditPart; +import org.tizen.webuibuilder.gef.figure.PartFigure; +import org.tizen.webuibuilder.gef.figure.WidgetFigure; +import org.tizen.webuibuilder.model.Part; import org.tizen.webuibuilder.model.app.AppManager; import org.tizen.webuibuilder.ui.editor.ScreenSize; import org.tizen.webuibuilder.ui.editor.dnd.listener.PageDesignerDropTargetListener; @@ -42,6 +48,8 @@ public class DesignerBrowserViewer extends HoverBrowserViewer { private DropTarget dropTarget; private PageDesignerDropTargetListener dropTargetListener; + protected boolean binded = false; + public DesignerBrowserViewer(AppManager appManager, /* PageData pageData, */ScreenSize screen, IEditorInput editorInput) { super(appManager, /* pageData, */screen, editorInput); @@ -107,4 +115,38 @@ public class DesignerBrowserViewer extends HoverBrowserViewer { getControl().addMouseListener(delegator); getControl().addKeyListener(delegator); } + + // 2014 04 28 casval + public boolean isShowBindingInfo() { + return binded; + } + + public void showBindingInfo(boolean isBinded) { + binded = isBinded; + showBindingInfo(binded, getCurrentPage()); + } + + private void showBindingInfo(boolean isBinded, HoverViewerEditPart viewer) { + + Part part = (Part) viewer.getModel(); + PartFigure f = (PartFigure) viewer.getFigure(); + + if (f instanceof WidgetFigure) { + WidgetFigure figure = (WidgetFigure) f; + String dataBind = part.getPropertyValue("data-bind"); + if (null != dataBind && !dataBind.isEmpty() && isBinded) { + figure.setBinded(true); + figure.setTooltipEnabled(true); + figure.setDataBindTooltipText(dataBind); + } else { + figure.setBinded(false); + figure.setTooltipEnabled(false); + } + figure.repaint(); + } + List children = viewer.getChildren(); + for (HoverViewerEditPart child : children) { + showBindingInfo(isBinded, child); + } + } } diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/HoverBrowserViewer.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/HoverBrowserViewer.java index 54e8dc2..2da55b1 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/HoverBrowserViewer.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/viewer/HoverBrowserViewer.java @@ -65,8 +65,6 @@ import org.tizen.webuibuilder.browserwidget.ImageBufferedBrowserWidget.ContentsA import org.tizen.webuibuilder.browserwidget.ProgressListener; import org.tizen.webuibuilder.gef.editparts.HoverViewerEditPart; import org.tizen.webuibuilder.gef.editparts.HoverViewerRootEditPart; -import org.tizen.webuibuilder.gef.figure.PartFigure; -import org.tizen.webuibuilder.gef.figure.WidgetFigure; import org.tizen.webuibuilder.model.AbsolutePositionProvider; import org.tizen.webuibuilder.model.IPartListener; import org.tizen.webuibuilder.model.Part; @@ -106,8 +104,6 @@ public class HoverBrowserViewer extends ScrollingGraphicalViewer // private IProject project; protected AppManager appManager; - protected boolean binded = false; - protected boolean isValidTempHtml = false; protected String tempHtml = null; protected String rootPathUri = null; @@ -591,36 +587,6 @@ public class HoverBrowserViewer extends ScrollingGraphicalViewer } } - public boolean isShowBindingInfo() { - return binded; - } - - public void showBindingInfo(boolean isBinded) { - binded = isBinded; - showBindingInfo(binded, getCurrentPage()); - } - - private void showBindingInfo(boolean isBinded, HoverViewerEditPart viewer) { - - Part part = (Part) viewer.getModel(); - PartFigure figure = (PartFigure) viewer.getFigure(); - - String dataBind = part.getPropertyValue("data-bind"); - if (null != dataBind && !dataBind.isEmpty() && isBinded) { - figure.setBinded(true); - figure.setTooltipEnabled(true); - figure.setDataBindTooltipText(dataBind); - } else { - figure.setBinded(false); - figure.setTooltipEnabled(false); - } - figure.repaint(); - List children = viewer.getChildren(); - for (HoverViewerEditPart child : children) { - showBindingInfo(isBinded, child); - } - } - public void zoomBrowser(float scale) { if (rootEditPart != null) { updateScrollBar(); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java index 51c052d..6a12fb5 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java @@ -29,8 +29,6 @@ import java.io.IOException; import java.net.MalformedURLException; import java.util.EventObject; import java.util.List; -import java.util.Timer; -import java.util.TimerTask; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -1062,14 +1060,6 @@ public class PageDesigner extends GraphicalEditor implements CommandStackListene } - public void showBindingInfo(boolean isBinded) { - designer.showBindingInfo(isBinded); - } - - public boolean isShowBindingInfo() { - return designer.isShowBindingInfo(); - } - public void setViewLocation(int x, int y) { designer.setViewLocation(x, y); if (animator != null) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesignerUtil.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesignerUtil.java deleted file mode 100644 index 8c05f1e..0000000 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesignerUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.tizen.webuibuilder.ui.editor; - -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -public class PageDesignerUtil { - public static PageDesigner getActivePageDesigner() { - if (getWorkbenchWindow() == null) { - return null; - } - IWorkbenchPage activePage = getWorkbenchWindow().getActivePage(); - if (activePage == null) { - IWorkbenchPage[] pages = getWorkbenchWindow().getPages(); - if (pages.length > 0) { - @SuppressWarnings("deprecation") - IEditorPart[] editors = pages[0].getEditors(); - for (int i = 0; i < editors.length; i++) { - if (editors[i] instanceof PageDesigner) { - return (PageDesigner) editors[i]; - } - } - } - } else { - IEditorPart activeEditor = activePage.getActiveEditor(); - if (activeEditor instanceof PageDesigner || activeEditor instanceof PageDesignerForHTML) { - return (PageDesigner) activeEditor; - } - } - return null; - } - - public static IWorkbenchWindow getWorkbenchWindow() { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - - return workbenchWindow; - } -} diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingPage.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingPage.java index ee5d67e..cb12cef 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingPage.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingPage.java @@ -1017,15 +1017,6 @@ public class DataBindingPage extends Page implements IBindingDataSetListener { makeBindingInfoContextMenu(); } - public void showDataBindingInfo(boolean show) { - // if (delegater != null) { - // delegater.showDataBindInfo(show); - // } - if (null != pageDesigner) { - pageDesigner.showBindingInfo(show); - } - } - public void removeBindingInfo() { TableItem[] tableItems = infoTableViewer.getTable().getSelection(); for (TableItem tableItem : tableItems) { @@ -1204,27 +1195,27 @@ public class DataBindingPage extends Page implements IBindingDataSetListener { Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "show_bind.gif"); ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img); - Action showBindingInfo = new Action("show data binding info", imgDesc) { + Action showBindingInfoAction = new Action("show data binding info", imgDesc) { public void run() { showBindInfo = !showBindInfo; - pageDesigner.showBindingInfo(showBindInfo); + pageDesigner.getViewer().showBindingInfo(showBindInfo); Image img = null; if (showBindInfo) { img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "hide_bind.gif"); + setText("hide data binding info"); } else { img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "show_bind.gif"); + setText("show data binding info"); } ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img); setImageDescriptor(imgDesc); } - }; - bindingInfoToolBarManager.add(showBindingInfo); + bindingInfoToolBarManager.add(showBindingInfoAction); bindingInfoToolBarManager.add(new Separator()); bindingInfoToolBarManager.add(removeBindingInfoAction); - bindingInfoToolBarManager.update(true); return toolBar; diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingView.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingView.java index 33842a0..132f4bd 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingView.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingView.java @@ -200,7 +200,7 @@ public class DataBindingView extends SimplePageBookView { if (editor instanceof PageDesigner) { pageDesigner = (PageDesigner) editor; if (null != page) { - pageDesigner.showBindingInfo(page.isShowBindInfo()); + pageDesigner.getViewer().showBindingInfo(page.isShowBindInfo()); } } else { pageDesigner = null; diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/ShowBindingInfoAction.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/ShowBindingInfoAction.java deleted file mode 100644 index 304b1c2..0000000 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/ShowBindingInfoAction.java +++ /dev/null @@ -1,52 +0,0 @@ - - -package org.tizen.webuibuilder.ui.views.databinding.actions; - -import org.eclipse.gef.ui.actions.SelectionAction; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.IPage; -import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage; -import org.tizen.webuibuilder.ui.views.databinding.DataBindingView; - - -public class ShowBindingInfoAction extends SelectionAction { - - protected DataBindingView view; - private boolean show; - - public ShowBindingInfoAction(String text, DataBindingView view) { - super(view); - setText(text); - this.view = view; - setImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); - } - - public void setToggle(boolean push) { - this.show = push; - } - - @Override - protected boolean calculateEnabled() { - return true; - } - - public void run() { - IPage page = view.getCurrentPage(); - if (!(page instanceof DataBindingPage)) { - return; - } - DataBindingPage dataBindingPage = (DataBindingPage) page; - show = !show; - dataBindingPage.showDataBindingInfo(show); - if (show) { - setImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_BACK_HOVER)); - } else { - setImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); - } - } -}