Skip to content

Commit

Permalink
Merge pull request #53 from Bios-Marcel/master
Browse files Browse the repository at this point in the history
Updated MigLayout
  • Loading branch information
eugener authored Apr 8, 2017
2 parents cab7317 + c1c3966 commit 956f076
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
10 changes: 5 additions & 5 deletions swingbits/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@


<dependencies>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<version>3.7.4</version>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>5.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@
import javax.swing.UIManager;
import javax.swing.event.AncestorEvent;

import net.miginfocom.swing.MigLayout;

import org.oxbow.swingbits.dialog.task.TaskDialog.StandardCommand;
import org.oxbow.swingbits.dialog.task.design.CommandLinkButton;
import org.oxbow.swingbits.dialog.task.design.CommandLinkButtonGroup;
import org.oxbow.swingbits.list.CheckList;
import org.oxbow.swingbits.util.Strings;
import org.oxbow.swingbits.util.swing.AncestorAdapter;

import net.miginfocom.layout.CC;
import net.miginfocom.layout.LC;
import net.miginfocom.swing.MigLayout;

/**
*
* A set of methods to simplify creation of task dialogs
Expand Down Expand Up @@ -379,15 +381,16 @@ public int choice( final int defaultChoice, List<CommandLink> choices ) {
final List<CommandLinkButton> buttons = new ArrayList<CommandLinkButton>();

CommandLinkButton btn;
JPanel p = new JPanel( new MigLayout(""));
p.setOpaque(false);
for( CommandLink link: choices ) {
btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter() );
models.add( btn.getModel());
buttons.add( btn );
bGroup.add(btn);
p.add( btn, "dock north, gapbottom 8");
}
final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid()));
p.setOpaque(false);
for (final CommandLink link : choices)
{
btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter());
models.add(btn.getModel());
buttons.add(btn);
bGroup.add(btn);
p.add(btn, new CC().gapBottom("8"));
}

if ( defaultChoice >= 0 && defaultChoice < choices.size()) {
bGroup.setSelected(models.get(defaultChoice), true);
Expand Down

0 comments on commit 956f076

Please sign in to comment.