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

Moving nested classes #4

Open
matthias-springer opened this issue Jun 24, 2015 · 1 comment
Open

Moving nested classes #4

matthias-springer opened this issue Jun 24, 2015 · 1 comment

Comments

@matthias-springer
Copy link
Contributor

There should be a way to move a nested class from one parent to another parent, e.g. using drag and drop.

@abstraktor
Copy link

I'll give up for now. We need to look at this together or it's a waste of time. Leftovers:

  • Cutting a class produces exceptions in the MethodView
  • use ModuleSystemViewHelper canPaste to hide the paste button
  • I don't know how to commit things
ModuleSystemViewHelper class>>canPaste
    ^cutSpec isNil not

ModuleSystemViewHelper class>>cut: aName from: aSpec 
    cutSpecName := aName.
    cutSpec := aSpec removeClassAt: aName

ModuleSystemViewHelper class>>pasteInto: aSpec 
    aSpec addClass: cutSpec name: cutSpecName.
    cutSpec := nil.
    cutSpecName := nil

SpecificationTest>>testAddClassName
    |spec added|
    added := ClassSpecification new.
    spec := ClassSpecification new.
    spec addClass: added name: 'added'.
    self assert: (spec classAt: 'added') equals: added.

SpecificationTest>>testRemoveClassAt
    |spec added|
    added := ClassSpecification new.
    spec := ClassSpecification new.
    spec addClass: added name: 'added'.
    self assert: (spec classAt: 'added') equals: added.

    self assert: (spec removeClassAt: 'added') equals: added.
    self assert: (spec classAt: 'added' ifAbsent: nil) equals: nil.
"ModuleSystemButtonBar"
[:memberSpecification | {
    #text -> 'Cut'.
    #icon -> UiSilkIcons cutIcon.
    #clicked -> [[
        ModuleSystemViewHelper cut: memberSpecification selector from: memberSpecification parent.
        ViEventNotifier trigger: #ModuleSystemModuleView]]}]

[:memberSpecification | {
    #text -> 'Paste Into'.
    #icon -> UiSilkIcons pastePlainIcon.
    #clicked -> [[
        ModuleSystemViewHelper pasteInto: memberSpecification.
        ViEventNotifier trigger: #ModuleSystemModuleView]]}]

@abstraktor abstraktor removed their assignment Jul 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants