Skip to content

Commit

Permalink
Remove editor actions not ready to release
Browse files Browse the repository at this point in the history
  • Loading branch information
dubreuia committed Jan 22, 2019
1 parent 7542af0 commit 334c87d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
21 changes: 12 additions & 9 deletions src/main/java/com/dubreuia/ui/BuildPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.dubreuia.model.Action;
import com.intellij.openapi.actionSystem.ex.QuickList;
import com.intellij.openapi.actionSystem.ex.QuickListsManager;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.ui.IdeBorderFactory;
import org.jdesktop.swingx.combobox.ListComboBoxModel;

Expand All @@ -18,8 +17,12 @@
import java.util.Map;

import static com.dubreuia.model.Action.compile;
import static com.dubreuia.model.Action.executeAction;
import static com.dubreuia.model.Action.reload;
import static com.dubreuia.ui.Configuration.BOX_LAYOUT_MAX_HEIGHT;
import static com.dubreuia.ui.Configuration.BOX_LAYOUT_MAX_WIDTH;
import static java.awt.BorderLayout.CENTER;
import static java.awt.BorderLayout.WEST;
import static java.lang.Short.MAX_VALUE;
import static java.util.stream.Collectors.toList;

class BuildPanel {
Expand All @@ -41,11 +44,11 @@ class BuildPanel {
panel.add(wrap(checkboxes.get(compile), null));
panel.add(wrap(checkboxes.get(reload), null));
}
@SuppressWarnings("unchecked")
JComboBox<QuickListWrapper> comboBox = new ComboBox<QuickListWrapper>(quickListModel);
panel.add(wrap(checkboxes.get(executeAction), comboBox));
// @SuppressWarnings("unchecked")
// JComboBox<QuickListWrapper> comboBox = new ComboBox<QuickListWrapper>(quickListModel);
// panel.add(wrap(checkboxes.get(executeAction), comboBox));
panel.add(Box.createHorizontalGlue());
panel.setMinimumSize(new Dimension(Short.MAX_VALUE, 0));
panel.setMinimumSize(new Dimension(MAX_VALUE, 0));
}

JPanel getPanel() {
Expand All @@ -71,13 +74,13 @@ void update(List<String> quickLists) {
private JComponent wrap(JCheckBox checkBox, JComboBox comboBox) {
JPanel wrapper = new JPanel();
wrapper.setLayout(new BorderLayout());
wrapper.add(checkBox, BorderLayout.WEST);
wrapper.add(checkBox, WEST);
if (comboBox != null) {
checkBox.addChangeListener(e -> comboBox.setEnabled(checkBox.isSelected()));
comboBox.setEnabled(checkBox.isSelected());
wrapper.add(comboBox, BorderLayout.CENTER);
wrapper.add(comboBox, CENTER);
}
wrapper.setMaximumSize(new Dimension(3000, 100));
wrapper.setMaximumSize(new Dimension(BOX_LAYOUT_MAX_WIDTH, BOX_LAYOUT_MAX_HEIGHT));
return wrapper;
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/dubreuia/ui/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

public class Configuration implements Configurable {

public static final int BOX_LAYOUT_MAX_WIDTH = 3000;
public static final int BOX_LAYOUT_MAX_HEIGHT = 100;

private static final String TEXT_DISPLAY_NAME = "Save Actions";

private final Storage storage;
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/com/dubreuia/ui/java/IdeSupportPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
import javax.swing.*;
import java.awt.*;

import static com.dubreuia.ui.Configuration.BOX_LAYOUT_MAX_HEIGHT;
import static com.dubreuia.ui.Configuration.BOX_LAYOUT_MAX_WIDTH;
import static com.intellij.openapi.ui.TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT;
import static java.awt.BorderLayout.CENTER;
import static java.awt.BorderLayout.EAST;
import static java.awt.BorderLayout.WEST;

/**
* @author markiewb
Expand All @@ -39,11 +44,11 @@ public JPanel getPanel(String configurationPath) {
path = getPath(configurationPath);
JButton reset = getResetButton(path);

panel.add(label, BorderLayout.WEST);
panel.add(path, BorderLayout.CENTER);
panel.add(reset, BorderLayout.EAST);
panel.add(label, WEST);
panel.add(path, CENTER);
panel.add(reset, EAST);

panel.setMaximumSize(new Dimension(3000, 100));
panel.setMaximumSize(new Dimension(BOX_LAYOUT_MAX_WIDTH, BOX_LAYOUT_MAX_HEIGHT));

return panel;
}
Expand Down

0 comments on commit 334c87d

Please sign in to comment.