Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Editor Codebase #69

Closed
AdamsLair opened this issue Jan 30, 2014 · 4 comments

Comments

@ghost
Copy link
Collaborator

commented Jan 30, 2014

  • While Duality's core is in quite a good shape, the editor code isn't so easy to get into.
  • it's too hard to write EditorPlugins :(
  • EditorBase is a bad example, since all the base modules, formats, etc. are crammed into one plugin.
  • IPropertyEditorProvider does a bad job and feels unnecessary.
  • CorePluginRegistry feels unnecessary, too: "Why do I need to register everything explicitly? I don't need to do so in a CorePlugin..."
  • Why are Type images and Type categories in an EditorPlugin, although EditorHints allow specifying metadata within a CorePlugin?
  • Why is there a separate DualityEditor namespace when Duality.Editor would be more appropriate? Also, EditorHints could go there as well.

Proposed Changes

  • Done: Split EditorBase into multiple separate EditorPlugins.
    • Probably one per module.
  • Done: Rename DualityEditor namespace to Duality.Editor
    • Also, move EditorHints there.
    • Plugin namespaces will be Duality.Editor.Plugins.XY
  • Done: Get rid of IPropertyEditorProviders, use Reflection instead.
    • Introduce [PropretyEditorAssignment] attribute
    • Can be used as a class attribute on classes deriving from PropertyEditor in order to link that editor to a specific Type (and its derivatives) to edit.
    • Can be used as a static method attribute on classes deriving from PropertyEditor in order to provide an assignment function that determines the level of Type association for that editor based on certain parameters.
  • Done: Get rid of RegisterTypeCategory and RegisterTypeImage
    • Use newly introduced EditorHints instead.
  • Done: If possible, get rid of CorePluginRegistry alltogether.
    • With PropertyEditors, TypeImages and TypeCategories gone, what's left is as follows:
    • Done: EditorActions: Could probably transform EditorActions to attributes, which can be assigned to static methods. Right now, that's what they are doing anyway.
    • Done: DataConverter; Could be replaced by using class attributes on DataConverters, assigning each one a target Type.
    • Done: PreviewGenerator: Don't even need an attribute. Just use all non-abstract classes implementing IPreviewGenerator.
    • Done: FileImporter: Dont' need an attribute here either. Again, just use Reflection.
    • Done: XmlCodeDoc: Move to HelpSystem.
    • Done: DesignTimeData: Move to DualityEditorApp or new helper class.
@ghost

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 22, 2014

Progress, see above.

2 similar comments
@ghost

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 27, 2014

Progress, see above.

@ghost

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 1, 2014

Progress, see above.

@ghost

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 3, 2014

Done.

@AdamsLair AdamsLair closed this Mar 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.