use of com.intellij.application.options.codeStyle.arrangement.group.ArrangementGroupingRulesControl in project intellij-community by JetBrains.
the class MoveArrangementGroupingRuleUpAction method update.
@Override
public void update(AnActionEvent e) {
ArrangementGroupingRulesControl control = ArrangementGroupingRulesControl.KEY.getData(e.getDataContext());
if (control == null) {
e.getPresentation().setEnabled(false);
return;
}
int[] rows = control.getSelectedRows();
e.getPresentation().setEnabled(rows.length == 1 && rows[0] != 0);
}
use of com.intellij.application.options.codeStyle.arrangement.group.ArrangementGroupingRulesControl in project intellij-community by JetBrains.
the class MoveArrangementGroupingRuleDownAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
ArrangementGroupingRulesControl control = ArrangementGroupingRulesControl.KEY.getData(e.getDataContext());
if (control == null) {
return;
}
int[] rows = control.getSelectedRows();
int row = rows[0];
if (rows.length != 1 || rows[0] == control.getRowCount() - 1) {
return;
}
if (control.isEditing()) {
control.getCellEditor().stopCellEditing();
}
DefaultTableModel model = control.getModel();
Object value = model.getValueAt(row, 0);
model.removeRow(row);
model.insertRow(row + 1, new Object[] { value });
control.getSelectionModel().setSelectionInterval(row + 1, row + 1);
}
use of com.intellij.application.options.codeStyle.arrangement.group.ArrangementGroupingRulesControl in project intellij-community by JetBrains.
the class MoveArrangementGroupingRuleUpAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
ArrangementGroupingRulesControl control = ArrangementGroupingRulesControl.KEY.getData(e.getDataContext());
if (control == null) {
return;
}
int[] rows = control.getSelectedRows();
int row = rows[0];
if (rows.length != 1 || row == 0) {
return;
}
if (control.isEditing()) {
control.getCellEditor().stopCellEditing();
}
DefaultTableModel model = control.getModel();
Object value = model.getValueAt(row, 0);
model.removeRow(row);
model.insertRow(row - 1, new Object[] { value });
control.getSelectionModel().setSelectionInterval(row - 1, row - 1);
}
use of com.intellij.application.options.codeStyle.arrangement.group.ArrangementGroupingRulesControl in project intellij-community by JetBrains.
the class MoveArrangementGroupingRuleDownAction method update.
@Override
public void update(AnActionEvent e) {
ArrangementGroupingRulesControl control = ArrangementGroupingRulesControl.KEY.getData(e.getDataContext());
if (control == null) {
e.getPresentation().setEnabled(false);
return;
}
int[] rows = control.getSelectedRows();
e.getPresentation().setEnabled(rows.length == 1 && rows[0] != control.getRowCount() - 1);
}
Aggregations