Java 类com.intellij.openapi.ui.DetailsComponent 实例源码

项目:intellij-ce-playground    文件:FacetStructureConfigurable.java   
public boolean updateMultiSelection(final List<NamedConfigurable> selectedConfigurables, final DetailsComponent detailsComponent) {
  FacetType selectedFacetType = null;
  List<FacetEditor> facetEditors = new ArrayList<FacetEditor>();
  for (NamedConfigurable selectedConfigurable : selectedConfigurables) {
    if (selectedConfigurable instanceof FacetConfigurable) {
      FacetConfigurable facetConfigurable = (FacetConfigurable)selectedConfigurable;
      FacetType facetType = facetConfigurable.getEditableObject().getType();
      if (selectedFacetType != null && selectedFacetType != facetType) {
        return false;
      }
      selectedFacetType = facetType;
      facetEditors.add(facetConfigurable.getEditor());
    }
  }
  if (facetEditors.size() <= 1 || selectedFacetType == null) {
    return false;
  }

  FacetEditor[] selectedEditors = facetEditors.toArray(new FacetEditor[facetEditors.size()]);
  MultipleFacetSettingsEditor editor = selectedFacetType.createMultipleConfigurationsEditor(myProject, selectedEditors);
  if (editor == null) {
    return false;
  }

  setSelectedNode(null);
  myCurrentMultipleSettingsEditor = editor;
  detailsComponent.setText(ProjectBundle.message("multiple.facets.banner.0.1.facets", selectedEditors.length,
                                                      selectedFacetType.getPresentableName()));
  detailsComponent.setContent(editor.createComponent());
  return true;
}
项目:intellij-ce-playground    文件:ProjectConfigurable.java   
@Override
public JComponent createOptionsPanel() {
  myDetailsComponent = new DetailsComponent(!Registry.is("ide.new.project.settings"), !Registry.is("ide.new.project.settings"));
  myDetailsComponent.setContent(myPanel);
  myDetailsComponent.setText(getBannerSlogan());

  myProjectJdkConfigurable.createComponent(); //reload changed jdks

  return myDetailsComponent.getComponent();
}
项目:intellij-ce-playground    文件:DefaultSdksConfigurable.java   
public DefaultSdksConfigurable(@Nullable AndroidProjectStructureConfigurable host, @Nullable Project project) {
  myHost = host;
  myProject = project;
  myWholePanel.setPreferredSize(new Dimension(700, 500));

  myDetailsComponent = new DetailsComponent();
  myDetailsComponent.setContent(myWholePanel);
  myDetailsComponent.setText("SDK Location");

  // We can't update The IDE-level ndk directory. Due to that disabling the ndk directory option in the default Project Structure dialog.
  if (myProject == null || myProject.isDefault()) {
    myNdkLocationTextField.setEnabled(false);
  }
  final CardLayout layout = (CardLayout)myNdkDownloadPanel.getLayout();
  layout.show(myNdkDownloadPanel, "loading");
  final SdkState sdkState = SdkState.getInstance(AndroidSdkUtils.tryToChooseAndroidSdk());
  sdkState.loadAsync(SdkState.DEFAULT_EXPIRATION_PERIOD_MS, false, null, new DispatchRunnable() {
    @Override
    public void doRun() {
      if (!sdkState.getPackages().getRemotePkgInfos().get(PkgType.PKG_NDK).isEmpty()) {
        layout.show(myNdkDownloadPanel, "link");
      }
      else {
        myNdkDownloadPanel.setVisible(false);
      }
    }
  }, new DispatchRunnable() {
    @Override
    public void doRun() {
      myNdkDownloadPanel.setVisible(false);
    }
  }, false);
}
项目:intellij-ce-playground    文件:ProjectProfileSelectionDialog.java   
@NotNull
private JComponent createProjectStructurePanel() {
  createProjectStructureTree();

  DetailsComponent details = new DetailsComponent();
  details.setText("Project Structure");
  details.setContent(createTreePanel(myProjectStructureTree));

  removeEmptyBorder(details);
  return details.getComponent();
}
项目:intellij-ce-playground    文件:ProjectProfileSelectionDialog.java   
@NotNull
private JComponent createConflictsPanel() {
  createConflictTree();

  myConflictDetails = new DetailsComponent();
  myConflictDetails.setText("Conflict Detail");
  myConflictDetails.setContent(createTreePanel(myConflictTree));
  removeEmptyBorder(myConflictDetails);

  createConflictsTable();

  myConflictsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      if (e.getValueIsAdjusting()) {
        return;
      }
      showConflictDetail();
    }
  });
  Splitter splitter = new Splitter(true, .25f);
  splitter.setHonorComponentsMinimumSize(true);

  DetailsComponent details = new DetailsComponent();
  details.setText("Variant Selection Conflicts");
  details.setContent(ScrollPaneFactory.createScrollPane(myConflictsTable));
  removeEmptyBorder(details);
  splitter.setFirstComponent(details.getComponent());

  splitter.setSecondComponent(myConflictDetails.getComponent());

  return splitter;
}
项目:intellij-ce-playground    文件:ProjectProfileSelectionDialog.java   
private static void removeEmptyBorder(@NotNull DetailsComponent details) {
  JComponent gutter = details.getContentGutter();
  for (Component child : gutter.getComponents()) {
    if (child instanceof Wrapper) {
      ((Wrapper)child).setBorder(null);
    }
  }
}
项目:tools-idea    文件:FacetStructureConfigurable.java   
public boolean updateMultiSelection(final List<NamedConfigurable> selectedConfigurables, final DetailsComponent detailsComponent) {
  FacetType selectedFacetType = null;
  List<FacetEditor> facetEditors = new ArrayList<FacetEditor>();
  for (NamedConfigurable selectedConfigurable : selectedConfigurables) {
    if (selectedConfigurable instanceof FacetConfigurable) {
      FacetConfigurable facetConfigurable = (FacetConfigurable)selectedConfigurable;
      FacetType facetType = facetConfigurable.getEditableObject().getType();
      if (selectedFacetType != null && selectedFacetType != facetType) {
        return false;
      }
      selectedFacetType = facetType;
      facetEditors.add(facetConfigurable.getEditor());
    }
  }
  if (facetEditors.size() <= 1 || selectedFacetType == null) {
    return false;
  }

  FacetEditor[] selectedEditors = facetEditors.toArray(new FacetEditor[facetEditors.size()]);
  MultipleFacetSettingsEditor editor = selectedFacetType.createMultipleConfigurationsEditor(myProject, selectedEditors);
  if (editor == null) {
    return false;
  }

  setSelectedNode(null);
  myCurrentMultipleSettingsEditor = editor;
  detailsComponent.setText(ProjectBundle.message("multiple.facets.banner.0.1.facets", selectedEditors.length,
                                                      selectedFacetType.getPresentableName()));
  detailsComponent.setContent(editor.createComponent());
  return true;
}
项目:tools-idea    文件:ProjectConfigurable.java   
@Override
public JComponent createOptionsPanel() {
  myDetailsComponent = new DetailsComponent();
  myDetailsComponent.setContent(myPanel);
  myDetailsComponent.setText(getBannerSlogan());

  myProjectJdkConfigurable.createComponent(); //reload changed jdks

  return myDetailsComponent.getComponent();
}
项目:consulo    文件:ProjectConfigurable.java   
@Override
public JComponent createOptionsPanel() {
  myDetailsComponent = new DetailsComponent(false, false);
  myDetailsComponent.setContent(myPanel);
  myDetailsComponent.setText(getBannerSlogan());
  return myDetailsComponent.getComponent();
}
项目:intellij-ce-playground    文件:ProjectStructureConfigurable.java   
@Override
public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) {
  final Configurable toSelect = (Configurable)place.getPath(CATEGORY);

  JComponent detailsContent = myDetails.getTargetComponent();

  if (mySelectedConfigurable != toSelect) {
    if (mySelectedConfigurable instanceof BaseStructureConfigurable) {
      ((BaseStructureConfigurable)mySelectedConfigurable).onStructureUnselected();
    }
    saveSideProportion();
    removeSelected();

    if (toSelect != null) {
      detailsContent = toSelect.createComponent();
      myDetails.setContent(detailsContent);
    }

    mySelectedConfigurable = toSelect;
    if (mySelectedConfigurable != null) {
      myUiState.lastEditedConfigurable = mySelectedConfigurable.getDisplayName();
    }

    if (toSelect instanceof MasterDetailsComponent) {
      final MasterDetailsComponent masterDetails = (MasterDetailsComponent)toSelect;
      if (myUiState.sideProportion > 0) {
        masterDetails.getSplitter().setProportion(myUiState.sideProportion);
      }
      masterDetails.setHistory(myHistory);
    }

    if (toSelect instanceof DetailsComponent.Facade) {
      ((DetailsComponent.Facade)toSelect).getDetailsComponent().setBannerMinHeight(myToolbarComponent.getPreferredSize().height);
    }

    if (toSelect instanceof BaseStructureConfigurable) {
      ((BaseStructureConfigurable)toSelect).onStructureSelected();
    }
  }



  if (detailsContent != null) {
    JComponent toFocus = IdeFocusTraversalPolicy.getPreferredFocusedComponent(detailsContent);
    if (toFocus == null) {
      toFocus = detailsContent;
    }
    if (requestFocus) {
      myToFocus = toFocus;
      UIUtil.requestFocus(toFocus);
    }
  }

  final ActionCallback result = new ActionCallback();
  Place.goFurther(toSelect, place, requestFocus).notifyWhenDone(result);

  myDetails.revalidate();
  myDetails.repaint();

  if (toSelect != null) {
    mySidePanel.select(createPlaceFor(toSelect));
  }

  if (!myHistory.isNavigatingNow() && mySelectedConfigurable != null) {
    myHistory.pushQueryPlace();
  }

  return result;
}
项目:intellij-ce-playground    文件:ProjectConfigurable.java   
@Override
public DetailsComponent getDetailsComponent() {
  return myDetailsComponent;
}
项目:intellij-ce-playground    文件:OptionsEditor.java   
void setContent(JComponent master, JComponent toolbar, DetailsComponent details, ConfigurationException e) {
  if (myMaster == master && myToolbar == toolbar && myDetails == details && myException == e) return;

  myMaster = master;
  myToolbar = toolbar;
  myDetails = details;
  myException = e;


  removeAll();
  myLeft.removeAll();

  myLeft.add(myToolbar, BorderLayout.NORTH);
  myLeft.add(myMaster, BorderLayout.CENTER);

  myDetails.setBannerMinHeight(myToolbar.getPreferredSize().height);

  mySplitter.setFirstComponent(myLeft);
  mySplitter.setSecondComponent(myDetails.getComponent());
  mySplitter.setProportion(myLastSplitterProportion);

  add(mySplitter, BorderLayout.CENTER);

  mySimpleContent = null;
}
项目:intellij-ce-playground    文件:IntentionSettingsConfigurable.java   
@Override
public DetailsComponent getDetails() {
  return myPanel.getDetails();
}
项目:intellij-ce-playground    文件:IntentionSettingsPanel.java   
@Override
public void initUi() {
  myDetailsComponent = new DetailsComponent();
  myDetailsComponent.setContent(myDescriptionPanel);
}
项目:intellij-ce-playground    文件:IntentionSettingsPanel.java   
@Override
public DetailsComponent getDetails() {
  return myDetailsComponent;
}
项目:tools-idea    文件:ProjectStructureConfigurable.java   
@Override
public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) {
  final Configurable toSelect = (Configurable)place.getPath(CATEGORY);

  JComponent detailsContent = myDetails.getTargetComponent();

  if (mySelectedConfigurable != toSelect) {
    if (mySelectedConfigurable instanceof BaseStructureConfigurable) {
      ((BaseStructureConfigurable)mySelectedConfigurable).onStructureUnselected();
    }
    saveSideProportion();
    removeSelected();

    if (toSelect != null) {
      detailsContent = toSelect.createComponent();
      myDetails.setContent(detailsContent);
    }

    mySelectedConfigurable = toSelect;
    if (mySelectedConfigurable != null) {
      myUiState.lastEditedConfigurable = mySelectedConfigurable.getDisplayName();
    }

    if (toSelect instanceof MasterDetailsComponent) {
      final MasterDetailsComponent masterDetails = (MasterDetailsComponent)toSelect;
      if (myUiState.sideProportion > 0) {
        masterDetails.getSplitter().setProportion(myUiState.sideProportion);
      }
      masterDetails.setHistory(myHistory);
    }

    if (toSelect instanceof DetailsComponent.Facade) {
      ((DetailsComponent.Facade)toSelect).getDetailsComponent().setBannerMinHeight(myToolbarComponent.getPreferredSize().height);
    }

    if (toSelect instanceof BaseStructureConfigurable) {
      ((BaseStructureConfigurable)toSelect).onStructureSelected();
    }
  }



  if (detailsContent != null) {
    JComponent toFocus = IdeFocusTraversalPolicy.getPreferredFocusedComponent(detailsContent);
    if (toFocus == null) {
      toFocus = detailsContent;
    }
    if (requestFocus) {
      myToFocus = toFocus;
      UIUtil.requestFocus(toFocus);
    }
  }

  final ActionCallback result = new ActionCallback();
  Place.goFurther(toSelect, place, requestFocus).notifyWhenDone(result);

  myDetails.revalidate();
  myDetails.repaint();

  if (toSelect != null) {
    mySidePanel.select(createPlaceFor(toSelect));
  }

  if (!myHistory.isNavigatingNow() && mySelectedConfigurable != null) {
    myHistory.pushQueryPlace();
  }

  return result;
}
项目:tools-idea    文件:ProjectConfigurable.java   
@Override
public DetailsComponent getDetailsComponent() {
  return myDetailsComponent;
}
项目:tools-idea    文件:IntentionSettingsConfigurable.java   
@Override
public DetailsComponent getDetails() {
  return myPanel.getDetails();
}
项目:tools-idea    文件:IntentionSettingsPanel.java   
@Override
public void initUi() {
  myDetailsComponent = new DetailsComponent();
  myDetailsComponent.setContent(myDescriptionPanel);
}
项目:tools-idea    文件:IntentionSettingsPanel.java   
@Override
public DetailsComponent getDetails() {
  return myDetailsComponent;
}
项目:tools-idea    文件:CodeStyleMainPanel.java   
public CodeStyleMainPanel(CodeStyleSchemesModel model, LanguageSelector langSelector, CodeStyleSettingsPanelFactory factory) {
  super(new BorderLayout());
  myModel = model;
  myFactory = factory;
  mySchemesPanel = new CodeStyleSchemesPanel(model);
  myLangSelector = langSelector;

  model.addListener(new CodeStyleSettingsListener(){
    @Override
    public void currentSchemeChanged(final Object source) {
      if (source != mySchemesPanel) {
        mySchemesPanel.onSelectedSchemeChanged();
      }
      onCurrentSchemeChanged();
    }

    @Override
    public void schemeListChanged() {
      mySchemesPanel.resetSchemesCombo();
    }

    @Override
    public void currentSettingsChanged() {
      ensureCurrentPanel().onSomethingChanged();
    }

    @Override
    public void usePerProjectSettingsOptionChanged() {
      mySchemesPanel.usePerProjectSettingsOptionChanged();
    }

    @Override
    public void schemeChanged(final CodeStyleScheme scheme) {
      ensurePanel(scheme).reset();
    }
  });

  myLangSelector.addListener(this);

  addWaitCard();

  add(mySchemesPanel.getPanel(), BorderLayout.NORTH);

  myDetailsComponent = new DetailsComponent();
  myDetailsComponent.setPaintBorder(false);
  myDetailsComponent.setContent(mySettingsPanel);
  myDetailsComponent.setText(getDisplayName());
  myDetailsComponent.setBannerMinHeight(24);

  add(myDetailsComponent.getComponent(), BorderLayout.CENTER);

  mySchemesPanel.resetSchemesCombo();
  mySchemesPanel.onSelectedSchemeChanged();
  onCurrentSchemeChanged();

}
项目:intellij-ce-playground    文件:MasterDetails.java   
DetailsComponent getDetails();
项目:tools-idea    文件:MasterDetails.java   
DetailsComponent getDetails();
项目:consulo    文件:MasterDetails.java   
DetailsComponent getDetails();