Java 类com.intellij.util.ui.ElementProducer 实例源码

项目:intellij-nette-tester    文件:TesterConfigurableForm.java   
private void createUIComponents() {
    defaultExtensionLabel = new JBLabel(TesterBundle.message("settings.defaultExtension"));
    defaultExtensionCombobox = new ComboBox<>(new String[]{"phpt", "php"});

    bootstrapFileLabel = new JBLabel(TesterBundle.message("settings.bootstrapFile"));
    bootstrapFileField = new TextFieldWithBrowseButton();
    bootstrapFileField.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));

    namespaceMappingTable = new NamespaceMappingTable(project);
    namespaceMappingPanel = ToolbarDecorator.createDecorator(namespaceMappingTable.getTableView(), new ElementProducer<TesterNamespaceMapping>() {
        @Override
        public TesterNamespaceMapping createElement() {
            return new TesterNamespaceMapping();
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    }).createPanel();

    namespaceMappingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.LIGHT_GRAY), TesterBundle.message("settings.namespaceMappings.title")));
}
项目:intellij-ce-playground    文件:TableToolbarDecorator.java   
TableToolbarDecorator(@NotNull JTable table, @Nullable final ElementProducer<?> producer) {
  myTable = table;
  myProducer = producer;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = isModelEditable();
  if (isModelEditable()) {
    createDefaultTableActions(producer);
  }
  myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      updateButtons();
    }
  });
  myTable.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:intellij-ce-playground    文件:TreeToolbarDecorator.java   
TreeToolbarDecorator(JTree tree, @Nullable final ElementProducer<?> producer) {
  myTree = tree;
  myProducer = producer;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = myTree.getModel() instanceof EditableTreeModel;
  if (myTree.getModel() instanceof EditableTreeModel) {
    createDefaultTreeActions();
  }
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      updateButtons();
    }
  });
  myTree.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:tools-idea    文件:TableToolbarDecorator.java   
TableToolbarDecorator(@NotNull JTable table, @Nullable final ElementProducer<?> producer) {
  myTable = table;
  myProducer = producer;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = isModelEditable();
  if (isModelEditable()) {
    createDefaultTableActions(producer);
  }
  myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      updateButtons();
    }
  });
  myTable.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:tools-idea    文件:TreeToolbarDecorator.java   
TreeToolbarDecorator(JTree tree, @Nullable final ElementProducer<?> producer) {
  myTree = tree;
  myProducer = producer;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = myTree.getModel() instanceof EditableTreeModel;
  if (myTree.getModel() instanceof EditableTreeModel) {
    createDefaultTreeActions();
  }
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      updateButtons();
    }
  });
  myTree.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:consulo    文件:TableToolbarDecorator.java   
TableToolbarDecorator(@Nonnull JTable table, @Nullable final ElementProducer<?> producer) {
  myTable = table;
  myProducer = producer;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = isModelEditable();
  if (isModelEditable()) {
    createDefaultTableActions(producer);
  }
  myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      updateButtons();
    }
  });
  myTable.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:consulo    文件:TreeToolbarDecorator.java   
TreeToolbarDecorator(JTree tree, @Nullable final ElementProducer<?> producer) {
  myTree = tree;
  myProducer = producer;
  myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = myTree.getModel() instanceof EditableTreeModel;
  if (myTree.getModel() instanceof EditableTreeModel) {
    createDefaultTreeActions();
  }
  myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent e) {
      updateButtons();
    }
  });
  myTree.addPropertyChangeListener("enabled", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateButtons();
    }
  });
}
项目:idea-php-symfony2-plugin    文件:MethodSignatureTypeSettingsForm.java   
@Nullable
@Override
public JComponent createComponent() {
    ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<MethodSignatureSetting>() {
        @Override
        public MethodSignatureSetting createElement() {
            //IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true);
            return null;
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    });

    tablePanel.setEditAction(anActionButton ->
        MethodSignatureTypeSettingsForm.this.openTwigPathDialog(MethodSignatureTypeSettingsForm.this.tableView.getSelectedObject())
    );

    tablePanel.setAddAction(anActionButton ->
        MethodSignatureTypeSettingsForm.this.openTwigPathDialog(null)
    );

    tablePanel.disableUpAction();
    tablePanel.disableDownAction();

    this.panelConfigTableView.add(tablePanel.createPanel());

    return this.panel1;
}
项目:idea-php-symfony2-plugin    文件:MethodParameterReferenceSettingsForm.java   
@Nullable
@Override
public JComponent createComponent() {
    ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<MethodParameterSetting>() {
        @Override
        public MethodParameterSetting createElement() {
            //IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true);
            return null;
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    });

    tablePanel.setEditAction(anActionButton ->
        MethodParameterReferenceSettingsForm.this.openTwigPathDialog(MethodParameterReferenceSettingsForm.this.tableView.getSelectedObject())
    );

    tablePanel.setAddAction(anActionButton ->
        MethodParameterReferenceSettingsForm.this.openTwigPathDialog(null)
    );

    tablePanel.disableUpAction();
    tablePanel.disableDownAction();

    this.panelConfigTableView.add(tablePanel.createPanel());

    return this.panel1;
}
项目:intellij-ce-playground    文件:ToolbarDecorator.java   
private static ToolbarDecorator createDecorator(@NotNull JTree tree, @Nullable ElementProducer<?> producer) {
  return new TreeToolbarDecorator(tree, producer).initPosition();
}
项目:intellij-ce-playground    文件:ToolbarDecorator.java   
public static <T> ToolbarDecorator  createDecorator(@NotNull TableView<T> table, @Nullable ElementProducer<T> producer) {
  return new TableToolbarDecorator(table, producer).initPosition();
}
项目:tools-idea    文件:ToolbarDecorator.java   
private static ToolbarDecorator createDecorator(@NotNull JTree tree, @Nullable ElementProducer<?> producer) {
  return new TreeToolbarDecorator(tree, producer).initPosition();
}
项目:tools-idea    文件:ToolbarDecorator.java   
public static <T> ToolbarDecorator  createDecorator(@NotNull TableView<T> table, @Nullable ElementProducer<T> producer) {
  return new TableToolbarDecorator(table, producer).initPosition();
}
项目:idea-php-annotation-plugin    文件:UseAliasListForm.java   
@Nullable
@Override
public JComponent createComponent() {
    ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<UseAliasOption>() {
        @Override
        public UseAliasOption createElement() {
            return null;
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    });

    tablePanel.setEditAction(anActionButton -> {

        UseAliasOption useAliasOption = tableView.getSelectedObject();
        if(useAliasOption == null) {
            return;
        }

        UseAliasForm.create(panel1, useAliasOption, option -> {
            tableView.getTableViewModel().fireTableDataChanged();
            changed = true;
        });
    });

    tablePanel.setAddAction(anActionButton -> UseAliasForm.create(panel1, option -> {
        tableView.getListTableModel().addRow(option);
        changed = true;
    }));

    tablePanel.setRemoveAction(anActionButton -> {
        modelList.removeRow(tableView.getSelectedRow());
        tableView.getTableViewModel().fireTableDataChanged();
        changed = true;
    });

    tablePanel.disableDownAction();
    tablePanel.disableUpAction();

    this.panel1.add(tablePanel.createPanel());

    return this.panel;
}
项目:consulo    文件:ToolbarDecorator.java   
private static ToolbarDecorator createDecorator(@Nonnull JTree tree, @Nullable ElementProducer<?> producer) {
  return new TreeToolbarDecorator(tree, producer).initPosition();
}
项目:consulo    文件:ToolbarDecorator.java   
public static <T> ToolbarDecorator createDecorator(@Nonnull TableView<T> table, @Nullable ElementProducer<T> producer) {
  return new TableToolbarDecorator(table, producer).initPosition();
}