本文整理汇总了Java中com.intellij.ide.diff.DirDiffOperation类的典型用法代码示例。如果您正苦于以下问题:Java DirDiffOperation类的具体用法?Java DirDiffOperation怎么用?Java DirDiffOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DirDiffOperation类属于com.intellij.ide.diff包,在下文中一共展示了DirDiffOperation类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Override
public final void update(AnActionEvent e) {
final DirDiffTableModel model = SetOperationToBase.getModel(e);
final JTable table = SetOperationToBase.getTable(e);
if (table != null && model != null) {
for (DirDiffElementImpl element : model.getSelectedElements()) {
if (element.getOperation() != DirDiffOperation.NONE) {
e.getPresentation().setEnabled(true);
return;
}
}
}
e.getPresentation().setEnabled(false);
}
示例2: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@NotNull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.COPY_TO;
}
示例3: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@NotNull
protected abstract DirDiffOperation getOperation();
示例4: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@NotNull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.COPY_FROM;
}
示例5: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@NotNull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.DELETE;
}
示例6: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@NotNull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.NONE;
}
示例7: getTableCellRendererComponent
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Override
public Component getTableCellRendererComponent(final JTable table, Object value, boolean isSelected, boolean hasFocus, final int row, final int column) {
final DirDiffTableModel model = (DirDiffTableModel)table.getModel();
final DirDiffElementImpl element = model.getElementAt(row);
if (element == null) return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
final int modelColumn = table.convertColumnIndexToModel(column);
if (element.isSeparator()) {
return new SimpleColoredComponent() {
{
setIcon(ObjectUtils.chooseNotNull(element.getSourceIcon(), element.getTargetIcon()));
append(element.getName());
}
@Override
protected void doPaint(Graphics2D g) {
int offset = 0;
int i = 0;
final TableColumnModel columnModel = table.getColumnModel();
while (i < column) {
offset += columnModel.getColumn(i).getWidth();
i++;
}
g.translate(-offset, 0);
super.doPaint(g);
g.translate(offset, 0);
}
};
}
final Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (c instanceof JLabel) {
final JLabel label = (JLabel)c;
Border border = label.getBorder();
if ((hasFocus || isSelected) && border != null) {
label.setBorder(new EmptyBorder(border.getBorderInsets(label)));
}
label.setIcon(null);
final DirDiffOperation op = element.getOperation();
if (modelColumn == (table.getColumnCount() - 1) / 2) {
label.setIcon(op.getIcon());
label.setHorizontalAlignment(CENTER);
return label;
}
Color fg = isSelected ? UIUtil.getTableSelectionForeground() : op.getTextColor();
label.setForeground(fg);
final String name = table.getColumnName(column);
if (DirDiffTableModel.COLUMN_DATE.equals(name)) {
label.setHorizontalAlignment(CENTER);
} else if (DirDiffTableModel.COLUMN_SIZE.equals(name)) {
label.setHorizontalAlignment(RIGHT);
} else {
label.setHorizontalAlignment(LEFT);
final String text = label.getText();
label.setText(" " + text);
if (text != null && text.trim().length() > 0) {
label.setIcon(modelColumn == 0 ? element.getSourceIcon() : element.getTargetIcon());
}
}
}
return c;
}
示例8: getTableCellRendererComponent
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Override
public Component getTableCellRendererComponent(final JTable table, Object value, boolean isSelected, boolean hasFocus, final int row, final int column) {
final DirDiffTableModel model = (DirDiffTableModel)table.getModel();
final DirDiffElementImpl element = model.getElementAt(row);
if (element == null) return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
final int modelColumn = table.convertColumnIndexToModel(column);
if (element.isSeparator()) {
return new SimpleColoredComponent() {
{
setIcon(ObjectUtils.chooseNotNull(element.getSourceIcon(), element.getTargetIcon()));
append(element.getName());
}
@Override
protected void doPaint(Graphics2D g) {
int offset = 0;
int i = 0;
final TableColumnModel columnModel = table.getColumnModel();
while (i < column) {
offset += columnModel.getColumn(i).getWidth();
i++;
}
g.translate(-offset, 0);
super.doPaint(g);
g.translate(offset, 0);
}
};
}
final Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (c instanceof JLabel) {
final JLabel label = (JLabel)c;
if (hasFocus || isSelected) {
label.setBorder(noFocusBorder);
}
label.setIcon(null);
final DirDiffOperation op = element.getOperation();
if (modelColumn == (table.getColumnCount() - 1) / 2) {
label.setIcon(op.getIcon());
label.setHorizontalAlignment(CENTER);
return label;
}
Color fg = isSelected ? UIUtil.getTableSelectionForeground() : op.getTextColor();
label.setForeground(fg);
final String name = table.getColumnName(column);
if (DirDiffTableModel.COLUMN_DATE.equals(name)) {
label.setHorizontalAlignment(CENTER);
} else if (DirDiffTableModel.COLUMN_SIZE.equals(name)) {
label.setHorizontalAlignment(RIGHT);
} else {
label.setHorizontalAlignment(LEFT);
final String text = label.getText();
label.setText(" " + text);
if (text != null && text.trim().length() > 0) {
label.setIcon(modelColumn == 0 ? element.getSourceIcon() : element.getTargetIcon());
}
}
}
return c;
}
示例9: getTableCellRendererComponent
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Override
public Component getTableCellRendererComponent(final JTable table, Object value, boolean isSelected, boolean hasFocus, final int row, final int column) {
final DirDiffTableModel model = (DirDiffTableModel)table.getModel();
final DirDiffElementImpl element = model.getElementAt(row);
if (element == null) return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
final int modelColumn = table.convertColumnIndexToModel(column);
if (element.isSeparator()) {
return new SimpleColoredComponent() {
{
setIcon(ObjectUtil.chooseNotNull(element.getSourceIcon(), element.getTargetIcon()));
append(element.getName());
}
@Override
protected void doPaint(Graphics2D g) {
int offset = 0;
int i = 0;
final TableColumnModel columnModel = table.getColumnModel();
while (i < column) {
offset += columnModel.getColumn(i).getWidth();
i++;
}
g.translate(-offset, 0);
super.doPaint(g);
g.translate(offset, 0);
}
};
}
final Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (c instanceof JLabel) {
final JLabel label = (JLabel)c;
Border border = label.getBorder();
if ((hasFocus || isSelected) && border != null) {
label.setBorder(new EmptyBorder(border.getBorderInsets(label)));
}
label.setIcon(null);
final DirDiffOperation op = element.getOperation();
if (modelColumn == (table.getColumnCount() - 1) / 2) {
label.setIcon(op.getIcon());
label.setHorizontalAlignment(CENTER);
return label;
}
Color fg = isSelected ? UIUtil.getTableSelectionForeground() : op.getTextColor();
label.setForeground(fg);
final String name = table.getColumnName(column);
if (DirDiffTableModel.COLUMN_DATE.equals(name)) {
label.setHorizontalAlignment(CENTER);
} else if (DirDiffTableModel.COLUMN_SIZE.equals(name)) {
label.setHorizontalAlignment(RIGHT);
} else {
label.setHorizontalAlignment(LEFT);
final String text = label.getText();
label.setText(" " + text);
if (text != null && text.trim().length() > 0) {
label.setIcon(modelColumn == 0 ? element.getSourceIcon() : element.getTargetIcon());
}
}
}
return c;
}
示例10: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Nonnull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.COPY_TO;
}
示例11: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Nonnull
protected abstract DirDiffOperation getOperation();
示例12: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Nonnull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.COPY_FROM;
}
示例13: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Nonnull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.DELETE;
}
示例14: getOperation
import com.intellij.ide.diff.DirDiffOperation; //导入依赖的package包/类
@Nonnull
@Override
protected DirDiffOperation getOperation() {
return DirDiffOperation.NONE;
}