<commit_before>/*
 * SecondaryReposWidget.java
 *
 * Copyright (C) 2009-18 by RStudio, Inc.
 *
 * Unless you have received this program directly from RStudio pursuant
 * to the terms of a commercial license agreement with RStudio, then
 * this program is licensed to you under the terms of version 3 of the
 * GNU Affero General Public License. This program is distributed WITHOUT
 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
 *
 */
package org.rstudio.studio.client.common.repos;

import java.util.ArrayList;

import org.rstudio.core.client.files.FileSystemItem;
import org.rstudio.core.client.widget.LabelWithHelp;
import org.rstudio.core.client.widget.MessageDialog;
import org.rstudio.core.client.widget.Operation;
import org.rstudio.core.client.widget.OperationWithInput;
import org.rstudio.core.client.widget.ProgressIndicator;
import org.rstudio.core.client.widget.ProgressOperationWithInput;
import org.rstudio.core.client.widget.SmallButton;
import org.rstudio.core.client.widget.ThemedButton;
import org.rstudio.studio.client.RStudioGinjector;
import org.rstudio.studio.client.common.FileDialogs;
import org.rstudio.studio.client.common.GlobalDisplay;
import org.rstudio.studio.client.common.mirrors.model.CRANMirror;
import org.rstudio.studio.client.common.spelling.SpellingService;
import org.rstudio.studio.client.server.ServerError;
import org.rstudio.studio.client.server.ServerRequestCallback;
import org.rstudio.studio.client.workbench.model.RemoteFileSystemContext;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.dom.client.SelectElement;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.inject.Inject;

public class SecondaryReposWidget extends Composite
{
   public SecondaryReposWidget()
   {
      RStudioGinjector.INSTANCE.injectMembers(this);
      
      repos_ = new ArrayList<CRANMirror>();
      
      VerticalPanel panel = new VerticalPanel();
      panel.addStyleName(RES.styles().panel());
      
      HorizontalPanel horizontal = new HorizontalPanel();
      listBox_ = new ListBox();
      listBox_.setMultipleSelect(false);
      listBox_.addStyleName(RES.styles().listBox());
      listBox_.getElement().<SelectElement>cast().setSize(6);
      horizontal.add(listBox_);
      
      VerticalPanel buttonPanel = new VerticalPanel();
      buttonPanel.addStyleName(RES.styles().buttonPanel());

      buttonAdd_ = createButton("Add...");
      buttonAdd_.addClickHandler(addButtonClicked_);
      buttonPanel.add(buttonAdd_);

      buttonRemove_ = createButton("Remove...");
      buttonRemove_.addClickHandler(removeButtonClicked_);
      buttonPanel.add(buttonRemove_);

      buttonUp_ = createButton("Up");
      buttonUp_.addClickHandler(upButtonClicked_);
      buttonPanel.add(buttonUp_);

      buttonDown_ = createButton("Down");
      buttonDown_.addClickHandler(downButtonClicked_);
      buttonPanel.add(buttonDown_);

      horizontal.add(buttonPanel);
      
      panel.add(horizontal);
      
      initWidget(panel);
   }

   @Inject
   void initialize(GlobalDisplay globalDisplay)<commit_msg>avoid secondary repo buttons to grow past list in desktop<commit_after>/*
 * SecondaryReposWidget.java
 *
 * Copyright (C) 2009-18 by RStudio, Inc.
 *
 * Unless you have received this program directly from RStudio pursuant
 * to the terms of a commercial license agreement with RStudio, then
 * this program is licensed to you under the terms of version 3 of the
 * GNU Affero General Public License. This program is distributed WITHOUT
 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
 *
 */
package org.rstudio.studio.client.common.repos;

import java.util.ArrayList;

import org.rstudio.core.client.files.FileSystemItem;
import org.rstudio.core.client.widget.LabelWithHelp;
import org.rstudio.core.client.widget.MessageDialog;
import org.rstudio.core.client.widget.Operation;
import org.rstudio.core.client.widget.OperationWithInput;
import org.rstudio.core.client.widget.ProgressIndicator;
import org.rstudio.core.client.widget.ProgressOperationWithInput;
import org.rstudio.core.client.widget.SmallButton;
import org.rstudio.core.client.widget.ThemedButton;
import org.rstudio.studio.client.RStudioGinjector;
import org.rstudio.studio.client.common.FileDialogs;
import org.rstudio.studio.client.common.GlobalDisplay;
import org.rstudio.studio.client.common.mirrors.model.CRANMirror;
import org.rstudio.studio.client.common.spelling.SpellingService;
import org.rstudio.studio.client.server.ServerError;
import org.rstudio.studio.client.server.ServerRequestCallback;
import org.rstudio.studio.client.workbench.model.RemoteFileSystemContext;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.dom.client.SelectElement;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.inject.Inject;

public class SecondaryReposWidget extends Composite
{
   public SecondaryReposWidget()
   {
      RStudioGinjector.INSTANCE.injectMembers(this);
      
      repos_ = new ArrayList<CRANMirror>();
      
      VerticalPanel panel = new VerticalPanel();
      panel.addStyleName(RES.styles().panel());
      
      HorizontalPanel horizontal = new HorizontalPanel();
      listBox_ = new ListBox();
      listBox_.setMultipleSelect(false);
      listBox_.addStyleName(RES.styles().listBox());
      listBox_.getElement().<SelectElement>cast().setSize(6);
      listBox_.setHeight("90px");
      horizontal.add(listBox_);
      
      VerticalPanel buttonPanel = new VerticalPanel();
      buttonPanel.addStyleName(RES.styles().buttonPanel());

      buttonAdd_ = createButton("Add...");
      buttonAdd_.addClickHandler(addButtonClicked_);
      buttonPanel.add(buttonAdd_);

      buttonRemove_ = createButton("Remove...");
      buttonRemove_.addClickHandler(removeButtonClicked_);
      buttonPanel.add(buttonRemove_);

      buttonUp_ = createButton("Up");
      buttonUp_.addClickHandler(upButtonClicked_);
      buttonPanel.add(buttonUp_);

      buttonDown_ = createButton("Down");
      buttonDown_.addClickHandler(downButtonClicked_);
      buttonPanel.add(buttonDown_);

      horizontal.add(buttonPanel);
      
      panel.add(horizontal);
      
      initWidget(panel);
   }

   @Inject
   void initialize(GlobalDisplay globalDisplay)
{'fraction_non_alphanumeric': 0.1079155672823219, 'fraction_numerical': 0.0029023746701846965, 'mean_word_length': 4.453956834532374, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3753511', 'n_tokens_mistral': 2317, 'n_tokens_neox': 2251, 'n_words': 407}