예제 #1
0
 /**
  * Creates a Heading with the passed in size and text.
  *
  * @param size size of the heading
  * @param text text for the heading
  */
 public Heading(final HeadingSize size, final String text) {
   this(size);
   setText(text);
 }
  @Override
  public void setMode(ViewMode mode) {
    this.mode = mode;

    if (mode == ViewMode.CREATE_STRUCTURE) {

      projectTypeLabel.setText(
          Constants.INSTANCE.Repository_structure_view_create_projectTypeLabel());

      groupIdTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_create_groupIdTextBoxHelpInline());
      artifactIdTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_create_artifactIdTextBoxHelpInline());
      versionTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_create_versionTextBoxHelpInline());

    } else if (mode == ViewMode.EDIT_SINGLE_MODULE_PROJECT) {

      projectTypeLabel.setText(
          Constants.INSTANCE.Repository_structure_view_edit_single_projectTypeLabel());

      groupIdTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_edit_single_groupIdTextBoxHelpInline());
      artifactIdTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_edit_single_artifactIdTextBoxHelpInline());
      versionTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_edit_single_versionTextBoxHelpInline());

      groupIdTextBox.setVisible(true);
      groupIdTextBoxHelpInline.setVisible(true);
      artifactIdTextBox.setVisible(true);
      artifactIdTextBoxHelpInline.setVisible(true);
      versionTextBox.setVisible(true);
      versionTextBoxHelpInline.setVisible(true);

    } else if (mode == ViewMode.EDIT_MULTI_MODULE_PROJECT) {

      projectTypeLabel.setText(
          Constants.INSTANCE.Repository_structure_view_edit_multi_projectTypeLabel());

      groupIdTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_edit_multi_groupIdTextBoxHelpInline());
      artifactIdTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_edit_multi_artifactIdTextBoxHelpInline());
      versionTextBoxHelpInline.setText(
          Constants.INSTANCE.Repository_structure_view_edit_multi_versionTextBoxHelpInline());

      groupIdTextBox.setVisible(true);
      groupIdTextBoxHelpInline.setVisible(true);
      artifactIdTextBox.setVisible(true);
      artifactIdTextBoxHelpInline.setVisible(true);
      versionTextBox.setVisible(true);
      versionTextBoxHelpInline.setVisible(true);

    } else if (mode == ViewMode.EDIT_UNMANAGED_REPOSITORY) {

      projectTypeLabel.setText(
          Constants.INSTANCE.Repository_structure_view_edit_unmanaged_projectTypeLabel());

      groupIdTextBox.setVisible(false);
      groupIdTextBoxHelpInline.setVisible(false);
      artifactIdTextBox.setVisible(false);
      artifactIdTextBoxHelpInline.setVisible(false);
      versionTextBox.setVisible(false);
      versionTextBoxHelpInline.setVisible(false);
    }
  }