<commit_before>package com.intellij.uiDesigner.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.uiDesigner.FormEditingUtil;
import com.intellij.uiDesigner.designSurface.GuiEditor;
import com.intellij.uiDesigner.RadComponent;

import java.util.ArrayList;

/**
 * @author <NAME>
 * @author <NAME>
 */
public final class StartInplaceEditingAction extends AnAction{
  private static final Logger LOG = Logger.getInstance("#com.intellij.uiDesigner.actions.StartInplaceEditingAction");

  private final GuiEditor myEditor;

  public StartInplaceEditingAction(final GuiEditor editor) {
    LOG.assertTrue(editor != null);
    myEditor = editor;
  }

  public void actionPerformed(final AnActionEvent e) {
    final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);
    final RadComponent component = selection.get(0);

    final int x = component.getX() + component.getWidth() / 2; // central X point
    final int y = component.getY() + component.getHeight() / 2; // central Y point

    myEditor.getInplaceEditingLayer().startInplaceEditing(x, y);
  }

  public void update(final AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);

    // Inplace editing can be started only if single component is selected
    if(selection.size() != 1){
      presentation.setEnabled(false);
      return;
    }

    // Selected component should have "inplace" property
    final RadComponent component = selection.get(0);
    final int x = component.getX() + component.getWidth() / 2; // central X point
    final int y = component.getY() + component.getHeight() / 2; // central Y point
    presentation.setEnabled(component.getInplaceProperty(x, y) != null);
  }
}<commit_msg>"Start inplace editing" action works now<commit_after>package com.intellij.uiDesigner.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.uiDesigner.FormEditingUtil;
import com.intellij.uiDesigner.designSurface.GuiEditor;
import com.intellij.uiDesigner.RadComponent;
import com.intellij.uiDesigner.propertyInspector.Property;

import java.util.ArrayList;

/**
 * @author <NAME>
 * @author <NAME>
 */
public final class StartInplaceEditingAction extends AnAction{
  private static final Logger LOG = Logger.getInstance("#com.intellij.uiDesigner.actions.StartInplaceEditingAction");

  private final GuiEditor myEditor;

  public StartInplaceEditingAction(final GuiEditor editor) {
    LOG.assertTrue(editor != null);
    myEditor = editor;
  }

  public void actionPerformed(final AnActionEvent e) {
    final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);
    final RadComponent component = selection.get(0);
    final Property defaultInplaceProperty = component.getDefaultInplaceProperty();
    myEditor.getInplaceEditingLayer().startInplaceEditing(component, defaultInplaceProperty, null, true);
  }

  public void update(final AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);

    // Inplace editing can be started only if single component is selected
    if(selection.size() != 1){
      presentation.setEnabled(false);
      return;
    }

    // Selected component should have "inplace" property
    final RadComponent component = selection.get(0);
    presentation.setEnabled(component.getDefaultInplaceProperty() != null);
  }
}
{'fraction_non_alphanumeric': 0.09664188669571905, 'fraction_numerical': 0.002563445270443476, 'mean_word_length': 4.957251908396946, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6037798', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1099, 'n_words': 252}