예제 #1
0
  public DiffContentPanel(EditableDiffView master, boolean isFirst) {
    this.master = master;
    this.isFirst = isFirst;

    setLayout(new BorderLayout());

    editorPane = new DecoratedEditorPane(this);
    editorPane.setEditable(false);
    scrollPane = new JScrollPane(editorPane);
    add(scrollPane);

    linesActions = new LineNumbersActionsBar(this, master.isActionsEnabled());
    actionsScrollPane = new JScrollPane(linesActions);
    actionsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    actionsScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
    actionsScrollPane.setBorder(null);
    add(actionsScrollPane, isFirst ? BorderLayout.LINE_END : BorderLayout.LINE_START);

    editorPane.putClientProperty(DiffHighlightsLayerFactory.HIGHLITING_LAYER_ID, this);
    if (!isFirst) {
      // disable focus traversal, but permit just the up-cycle on ESC key
      editorPane.setFocusTraversalKeys(
          KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, Collections.EMPTY_SET);
      editorPane.setFocusTraversalKeys(
          KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, Collections.EMPTY_SET);
      editorPane.setFocusTraversalKeys(
          KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
          Collections.singleton(KeyStroke.getAWTKeyStroke(KeyEvent.VK_ESCAPE, 0)));

      editorPane.putClientProperty("errorStripeOnly", Boolean.TRUE);
      editorPane.putClientProperty("code-folding-enable", false);
    }
  }
 @Override
 @NotNull
 public Set<String> getRootsToWatch() {
   final File path = new File(getExternalResourcesPath());
   if (!path.exists() && !path.mkdirs()) {
     LOG.warn("Unable to create: " + path);
   }
   return Collections.singleton(path.getAbsolutePath());
 }
 public UnstashConflictResolver(Project project, VirtualFile root, StashInfo stashInfo) {
   super(
       project,
       ServiceManager.getService(Git.class),
       ServiceManager.getService(PlatformFacade.class),
       Collections.singleton(root),
       makeParams(stashInfo));
   myRoot = root;
   myStashInfo = stashInfo;
 }
예제 #4
0
 public void actionPerformed(ActionEvent e) {
   Iterator toInterp = Collections.singleton(desc).iterator();
   JMenuItem jmi = (JMenuItem) e.getSource();
   Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText());
   if (marks.hasNext()) {
     ChronicleMarker marker = (ChronicleMarker) marks.next();
     Instant to = marker.getWhen();
     Instant from = mediator.getMajorMoment();
     mediator.getPropagator().interpolateDescriptors(toInterp, from, to);
   }
 }
 @NotNull
 public Iterable<PyElement> iterateNames() {
   return Collections.<PyElement>singleton(this);
 }
예제 #6
0
 public void actionPerformed(ActionEvent e) {
   Iterator toInterp = Collections.singleton(desc).iterator();
   ViperViewMediator m = getMediator();
   InterpQuery iq = new InterpQuery(toInterp, m);
   iq.setVisible(true);
 }