mirror of https://github.com/zlatinb/muwire
add a Close button to result details frame
parent
38948034a1
commit
2128d3eac7
|
@ -1,8 +1,20 @@
|
|||
package com.muwire.gui.resultdetails
|
||||
|
||||
import griffon.core.artifact.GriffonController
|
||||
import griffon.core.controller.ControllerAction
|
||||
import griffon.inject.MVCMember
|
||||
import griffon.metadata.ArtifactProviderFor
|
||||
|
||||
import javax.annotation.Nonnull
|
||||
|
||||
@ArtifactProviderFor(GriffonController)
|
||||
class ResultDetailsFrameController {
|
||||
@MVCMember @Nonnull
|
||||
ResultDetailsFrameView view
|
||||
|
||||
@ControllerAction
|
||||
void close() {
|
||||
view.window.setVisible(false)
|
||||
mvcGroup.destroy()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muwire.gui.resultdetails
|
|||
import net.i2p.data.Destination
|
||||
|
||||
import javax.swing.JPanel
|
||||
import javax.swing.border.Border
|
||||
import java.awt.BorderLayout
|
||||
import java.awt.Dimension
|
||||
import java.awt.event.WindowAdapter
|
||||
import java.awt.event.WindowEvent
|
||||
|
@ -35,11 +37,13 @@ class ResultDetailsFrameView {
|
|||
void initUI() {
|
||||
int rowHeight = application.context.get("row-height")
|
||||
|
||||
int frameHeight = 100
|
||||
int frameHeight = 200
|
||||
window = builder.frame(visible : false, locationRelativeTo: application.windowManager.findWindow("main-frame"),
|
||||
defaultCloseOperation: JFrame.DISPOSE_ON_CLOSE,
|
||||
iconImage: builder.imageIcon("/MuWire-48x48.png").image,
|
||||
title: trans("DETAILS_FOR", model.resultEvent.name)) {
|
||||
borderLayout()
|
||||
panel(constraints: BorderLayout.CENTER) {
|
||||
gridBagLayout()
|
||||
int gridy = 0
|
||||
panel(border: titledBorder(title: trans("BASIC_DETAILS"), border: etchedBorder(), titlePosition: TitledBorder.TOP),
|
||||
|
@ -93,6 +97,10 @@ class ResultDetailsFrameView {
|
|||
}
|
||||
}
|
||||
}
|
||||
panel(constraints: BorderLayout.SOUTH) {
|
||||
button(text : trans("CLOSE"), closeAction)
|
||||
}
|
||||
}
|
||||
|
||||
window.setPreferredSize([800, frameHeight] as Dimension)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue