use of org.eclipse.draw2d.RangeModel in project archi by archimatetool.
the class DrawerEditPart method restoreState.
/**
* @see org.eclipse.gef.ui.palette.editparts.PaletteEditPart#restoreState(org.eclipse.ui.IMemento)
*/
@SuppressWarnings("deprecation")
@Override
public void restoreState(IMemento memento) {
setExpanded(new Boolean(memento.getString(PROPERTY_EXPANSION_STATE)).booleanValue());
setPinnedOpen(new Boolean(memento.getString(PROPERTY_PINNED_STATE)).booleanValue());
RangeModel rModel = getDrawerFigure().getScrollpane().getViewport().getVerticalRangeModel();
rModel.setMinimum(memento.getInteger(RangeModel.PROPERTY_MINIMUM).intValue());
rModel.setMaximum(memento.getInteger(RangeModel.PROPERTY_MAXIMUM).intValue());
rModel.setExtent(memento.getInteger(RangeModel.PROPERTY_EXTENT).intValue());
rModel.setValue(memento.getInteger(RangeModel.PROPERTY_VALUE).intValue());
super.restoreState(memento);
}
use of org.eclipse.draw2d.RangeModel in project archi by archimatetool.
the class DrawerEditPart method saveState.
/**
* @see org.eclipse.gef.ui.palette.editparts.PaletteEditPart#saveState(org.eclipse.ui.IMemento)
*/
@SuppressWarnings("deprecation")
@Override
public void saveState(IMemento memento) {
memento.putString(PROPERTY_EXPANSION_STATE, new Boolean(isExpanded()).toString());
memento.putString(PROPERTY_PINNED_STATE, new Boolean(isPinnedOpen()).toString());
RangeModel rModel = getDrawerFigure().getScrollpane().getViewport().getVerticalRangeModel();
memento.putInteger(RangeModel.PROPERTY_MINIMUM, rModel.getMinimum());
memento.putInteger(RangeModel.PROPERTY_MAXIMUM, rModel.getMaximum());
memento.putInteger(RangeModel.PROPERTY_EXTENT, rModel.getExtent());
memento.putInteger(RangeModel.PROPERTY_VALUE, rModel.getValue());
super.saveState(memento);
}
Aggregations