/** {@inheritDoc} */ @Override protected IFigure doCreateFigure() { LinkingContainerModel widget = (LinkingContainerModel) getContainerModel(); LinkingContainerFigure linkingContainerFigure = new LinkingContainerFigure(); linkingContainerFigure.setAutoFit(widget.isAutoZoom()); return linkingContainerFigure; }
protected IStatus clearContainer(final IProgressMonitor progressMonitor) { // remove old widgets Iterator<AbstractWidgetModel> it = _container.getWidgets().iterator(); while (it.hasNext()) { _container.removeWidget(it.next()); } _container.setResourceLoaded(false); updateZoom(); return Status.OK_STATUS; }
protected void showMessage(final IProgressMonitor progressMonitor, final String message) { // clear the container clearContainer(progressMonitor); // add a temporary widget final LabelModel loadingMessage = new LabelModel(); loadingMessage.setColor(AbstractWidgetModel.PROP_COLOR_FOREGROUND, "#0000C8"); loadingMessage.setTextValue(message); loadingMessage.setLocation(0, 0); int w = _container.getWidth(); loadingMessage.setWidth(w); int h = _container.getHeight(); loadingMessage.setHeight(h); _container.addWidget(loadingMessage); }
/** {@inheritDoc} */ @Override protected void registerPropertyChangeHandlers() { IWidgetPropertyChangeHandler handler = new IWidgetPropertyChangeHandler() { public boolean handleChange( final Object oldValue, final Object newValue, final IFigure figure) { loadResource((IPath) newValue, (LinkingContainerFigure) figure); return true; } }; setPropertyChangeHandler(LinkingContainerModel.PROP_RESOURCE, handler); LinkingContainerModel m = (LinkingContainerModel) getContainerModel(); if (!m.isResourceLoaded()) { loadResource(m.getResource(), (LinkingContainerFigure) getFigure()); } }