public DiagramEditor() { super(); setEditDomain(new DefaultEditDomain(this)); getActionRegistry().registerAction(new UndoRetargetAction()); getActionRegistry().registerAction(new RedoRetargetAction()); getActionRegistry().registerAction(new DeleteRetargetAction()); UMLPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); ResourcesPlugin.getWorkspace().addResourceChangeListener(this); }
protected void applyPreferences() { IPreferenceStore store = UMLPlugin.getDefault().getPreferenceStore(); getGraphicalViewer() .setProperty( SnapToGrid.PROPERTY_GRID_ENABLED, new Boolean(store.getBoolean(UMLPlugin.PREF_SHOW_GRID))); getGraphicalViewer() .setProperty( SnapToGrid.PROPERTY_GRID_VISIBLE, new Boolean(store.getBoolean(UMLPlugin.PREF_SHOW_GRID))); int gridSize = store.getInt(UMLPlugin.PREF_GRID_SIZE); getGraphicalViewer() .setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(gridSize, gridSize)); getGraphicalViewer() .setProperty( SnapToGeometry.PROPERTY_SNAP_ENABLED, new Boolean(store.getBoolean(UMLPlugin.PREF_SNAP_GEOMETRY))); }
public void dispose() { UMLPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); super.dispose(); }