Skip to content

Commit

Permalink
[481750] Add 'Abstract' prefix to FXEditor and FXView.
Browse files Browse the repository at this point in the history
To ensure consistency with the GEF4 naming conventions, renamed FXEditor
to AbstractFXEditor and FXView to AbstractFXView.
  • Loading branch information
nyssen committed Nov 9, 2015
1 parent 8aa3d58 commit 7ef5b66
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import org.eclipse.gef4.mvc.examples.logo.MvcLogoExample;
import org.eclipse.gef4.mvc.examples.logo.MvcLogoExampleModule;
import org.eclipse.gef4.mvc.examples.logo.ui.MvcLogoExampleUiModule;
import org.eclipse.gef4.mvc.fx.ui.parts.FXView;
import org.eclipse.gef4.mvc.fx.ui.parts.AbstractFXView;
import org.eclipse.gef4.mvc.models.ContentModel;

import com.google.inject.Guice;
import com.google.inject.util.Modules;

public class MvcLogoExampleView extends FXView {
public class MvcLogoExampleView extends AbstractFXView {

// TODO: create FXView via an executable extension factory (obtaining the
// TODO: create AbstractFXView via an executable extension factory (obtaining the
// injector via the bundle)
public MvcLogoExampleView() {
super(Guice.createInjector(Modules.override(new MvcLogoExampleModule())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
* @author Alexander Nyßen (anyssen)
* @author Matthias Wienand (mwienand)
*/
// TODO: make concrete or rename
public abstract class FXEditor extends EditorPart {
public abstract class AbstractFXEditor extends EditorPart {

@Inject
private FXDomain domain;
Expand All @@ -69,15 +68,15 @@ public abstract class FXEditor extends EditorPart {
private boolean isDirty;

/**
* Constructs a new {@link FXEditor} and uses the given {@link Injector} to
* inject its members.
* Constructs a new {@link AbstractFXEditor} and uses the given
* {@link Injector} to inject its members.
*
* @param injector
* The {@link Injector} that is used to inject the editor's
* members.
*/
// TOOD: use executable extension factory to inject this class
public FXEditor(final Injector injector) {
public AbstractFXEditor(final Injector injector) {
injector.injectMembers(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
* @author Alexander Nyßen (anyssen)
*
*/
// TODO: make concrete or rename
public abstract class FXView extends ViewPart {
public abstract class AbstractFXView extends ViewPart {

@Inject
private FXDomain domain;
Expand All @@ -62,21 +61,21 @@ public abstract class FXView extends ViewPart {
private IPropertySheetPage propertySheetPage;

/**
* Constructs a new {@link FXView} that uses the given {@link Injector} to
* inject its members.
* Constructs a new {@link AbstractFXView} that uses the given
* {@link Injector} to inject its members.
*
* @param injector
* The {@link Injector} that is used to inject the members of
* this {@link FXView}.
* this {@link AbstractFXView}.
*/
// TOOD: use executable extension factory to inject this class
public FXView(final Injector injector) {
public AbstractFXView(final Injector injector) {
injector.injectMembers(this);
}

/**
* Activates this {@link FXView} by activating the {@link FXDomain} that was
* previously injected.
* Activates this {@link AbstractFXView} by activating the {@link FXDomain}
* that was previously injected.
*/
protected void activate() {
domain.activate();
Expand Down Expand Up @@ -109,8 +108,8 @@ public void createPartControl(final Composite parent) {
}

/**
* Deactivates this {@link FXView} by deactivating its {@link FXDomain} that
* was previously injected.
* Deactivates this {@link AbstractFXView} by deactivating its
* {@link FXDomain} that was previously injected.
*/
protected void deactivate() {
domain.deactivate();
Expand Down Expand Up @@ -200,11 +199,11 @@ protected FXViewer getViewer() {
}

/**
* Hooks all viewers that are part of this {@link FXView} into the
* Hooks all viewers that are part of this {@link AbstractFXView} into the
* {@link FXCanvas} that was previously created by the injected
* {@link IFXCanvasFactory}. Also registers listeners for the propagation of
* a selection from the Eclipse Workbench to this {@link FXView} and vice
* versa.
* a selection from the Eclipse Workbench to this {@link AbstractFXView} and
* vice versa.
*/
protected void hookViewers() {
// by default we only have a single (content) viewer, so hook its
Expand Down Expand Up @@ -248,8 +247,8 @@ public void setFocus() {
}

/**
* Unhooks all viewers that are part of this {@link FXView} by unregistering
* the selection listeners.
* Unhooks all viewers that are part of this {@link AbstractFXView} by
* unregistering the selection listeners.
*/
// TODO: What about taking the visuals out of the canvas?
protected void unhookViewers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ protected void registerUndoRedoActions(final IEditorPart targetEditor) {
@Override
public void setActiveEditor(final IEditorPart activeEditor) {
registerUndoRedoActions(activeEditor);
deleteActionHandler.init(((FXEditor) activeEditor).getViewer());
deleteActionHandler.init(((AbstractFXEditor) activeEditor).getViewer());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.List;

import org.eclipse.gef4.graph.Graph;
import org.eclipse.gef4.mvc.fx.ui.parts.FXView;
import org.eclipse.gef4.mvc.fx.ui.parts.AbstractFXView;
import org.eclipse.gef4.mvc.fx.viewer.FXViewer;
import org.eclipse.gef4.mvc.models.ContentModel;
import org.eclipse.gef4.zest.fx.ZestFxModule;
Expand All @@ -27,15 +27,15 @@
import com.google.inject.util.Modules;

/**
* The {@link ZestFxUiView} is an extension to the {@link FXView}. It creates an
* The {@link ZestFxUiView} is an extension to the {@link AbstractFXView}. It creates an
* {@link Injector} based on the {@link ZestFxModule} and {@link ZestFxUiModule}
* by default. Other than that, it provides a {@link #setGraph(Graph) method} to
* change the {@link Graph} that is displayed.
*
* @author mwienand
*
*/
public class ZestFxUiView extends FXView {
public class ZestFxUiView extends AbstractFXView {

/**
* Constructs a new {@link ZestFxUiView}. Uses an {@link Injector} that is
Expand Down

0 comments on commit 7ef5b66

Please sign in to comment.