<commit_before>/*
 *  Copyright 2009 Anuradha.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package org.netbeans.cubeon.gcode.tasks;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.Action;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.cubeon.common.ui.TaskEditor;
import org.netbeans.cubeon.common.ui.components.ComponentBuilder;
import org.netbeans.cubeon.common.ui.components.ComponentContainer;
import org.netbeans.cubeon.common.ui.components.TextEditorUI;
import org.netbeans.cubeon.gcode.tasks.actions.OpenInBrowserTaskAction;
import org.netbeans.cubeon.gcode.tasks.actions.SubmitTaskAction;
import org.openide.util.NbBundle;

/**
 *
 * @author Anuradha
 */
public class GCodeTaskEditor {

    private static final String EMPTY = "";
    private final GCodeTask task;
    private final TaskEditor editor;
    private AtomicBoolean modifiedFlag = new AtomicBoolean(false);
    private final OpenInBrowserTaskAction openInBrowserTaskAction;
    private final SubmitTaskAction submitTaskAction;
    private ComponentBuilder builder = new ComponentBuilder() {

        @Override
        public void valueChanged() {
            fireChangeEvent();
        }
    };
    private ComponentContainer arrributesContainer = new ComponentContainer();
    private final TextEditorUI descriptionComponent = new TextEditorUI();
    private final TextEditorUI newCommentComponent = new TextEditorUI();
    //default trac fields
    private JComboBox status;
    private JLabel reportedBy;
    private JTextField assignee;
    private JTextField cc;
    private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);

    public GCodeTaskEditor(TaskEditor editor, GCodeTask task) {
        this.editor = editor;
        this.task = task;
        openInBrowserTaskAction = new OpenInBrowserTaskAction(task);
        submitTaskAction = new SubmitTaskAction(task);
        editor.addSummaryDocumentListener(builder.getDocumentListener());
        descriptionComponent.getDocument().addDocumentListener(builder.getDocumentListener());
        newCommentComponent.getDocument().addDocumentListener(builder.getDocumentListener());
        buildComponents();
    }

    private void buildComponents() {
        //build attribute



        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_Reported_By")), reportedBy = builder.createLabelField(" - "));
        arrributesContainer.nextSection();
        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_Status")), status = builder.createComboBox());
        //move to next row
        arrributesContainer.nextSection();
        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_Assignee")), assignee = builder.createTextField());
        arrributesContainer.nextSection();
        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_CC")), cc = builder.createTextField());


    }

    public void refresh() {
        //desable notify
        builder.setNotifyMode(false);
        loadDates();
        editor.setStatus(
                task.isLocal()
                ? NbBundle.getMessage(GCodeTaskEditor.class, "LBL_Local")
                : task.getStatus());
        editor.setSummaryText(task.getName());


<commit_msg>Issue 16: updata cc component width <commit_after>/*
 *  Copyright 2009 Anuradha.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package org.netbeans.cubeon.gcode.tasks;

import java.awt.Dimension;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.Action;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.cubeon.common.ui.TaskEditor;
import org.netbeans.cubeon.common.ui.components.ComponentBuilder;
import org.netbeans.cubeon.common.ui.components.ComponentContainer;
import org.netbeans.cubeon.common.ui.components.TextEditorUI;
import org.netbeans.cubeon.gcode.tasks.actions.OpenInBrowserTaskAction;
import org.netbeans.cubeon.gcode.tasks.actions.SubmitTaskAction;
import org.openide.util.NbBundle;

/**
 *
 * @author Anuradha
 */
public class GCodeTaskEditor {

    private static final String EMPTY = "";
    private final GCodeTask task;
    private final TaskEditor editor;
    private AtomicBoolean modifiedFlag = new AtomicBoolean(false);
    private final OpenInBrowserTaskAction openInBrowserTaskAction;
    private final SubmitTaskAction submitTaskAction;
    private ComponentBuilder builder = new ComponentBuilder() {

        @Override
        public void valueChanged() {
            fireChangeEvent();
        }
    };
    private ComponentContainer arrributesContainer = new ComponentContainer();
    private final TextEditorUI descriptionComponent = new TextEditorUI();
    private final TextEditorUI newCommentComponent = new TextEditorUI();
    //default trac fields
    private JComboBox status;
    private JLabel reportedBy;
    private JTextField assignee;
    private JTextField cc;
    private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);

    public GCodeTaskEditor(TaskEditor editor, GCodeTask task) {
        this.editor = editor;
        this.task = task;
        openInBrowserTaskAction = new OpenInBrowserTaskAction(task);
        submitTaskAction = new SubmitTaskAction(task);
        editor.addSummaryDocumentListener(builder.getDocumentListener());
        descriptionComponent.getDocument().addDocumentListener(builder.getDocumentListener());
        newCommentComponent.getDocument().addDocumentListener(builder.getDocumentListener());
        buildComponents();
    }

    private void buildComponents() {
        //build attribute



        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_Reported_By")), reportedBy = builder.createLabelField(" - "));
        arrributesContainer.nextSection();
        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_Status")), status = builder.createComboBox());
        //move to next row
        arrributesContainer.nextSection();
        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_Assignee")), assignee = builder.createTextField());
        arrributesContainer.nextSection();
        arrributesContainer.addComponentGroup(
                builder.createLabel(NbBundle.getMessage(GCodeTaskEditor.class,
                "LBL_CC")), cc = builder.createTextField());
        cc.setPreferredSize(new Dimension(builder.getComponentPreferredWidth()*2, builder.getComponentHight()));

    }

    public void refresh() {
        //desable notify
        builder.setNotifyMode(false);
        loadDates();
        editor.setStatus(
                task.isLocal()
                ? NbBundle.getMessage(GCodeTaskEditor.class, "LBL_Local")
                : task.getStatus());
        editor.setSummaryText(task.getName());



{'fraction_non_alphanumeric': 0.08881578947368421, 'fraction_numerical': 0.002302631578947368, 'mean_word_length': 3.515346534653465, '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': '834672', 'n_tokens_mistral': 2423, 'n_tokens_neox': 2376, 'n_words': 563}