Search in sources :

Example 1 with ScopeDescriptor

use of com.intellij.ide.util.scopeChooser.ScopeDescriptor in project intellij-community by JetBrains.

the class FindDialog method createGlobalScopePanel.

@NotNull
private JComponent createGlobalScopePanel() {
    JPanel scopePanel = new JPanel();
    scopePanel.setLayout(new GridBagLayout());
    scopePanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.scope.group"), true));
    GridBagConstraints gbConstraints = new GridBagConstraints();
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.anchor = GridBagConstraints.WEST;
    gbConstraints.gridx = 0;
    gbConstraints.gridy = 0;
    gbConstraints.gridwidth = 3;
    gbConstraints.weightx = 1;
    final boolean canAttach = ProjectAttachProcessor.canAttachToProject();
    myRbProject = new JRadioButton(canAttach ? FindBundle.message("find.scope.all.projects.radio") : FindBundle.message("find.scope.whole.project.radio"), true);
    scopePanel.add(myRbProject, gbConstraints);
    ItemListener resultsPreviewUpdateListener = new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            scheduleResultsUpdate();
        }
    };
    myRbProject.addItemListener(resultsPreviewUpdateListener);
    gbConstraints.gridx = 0;
    gbConstraints.gridy++;
    gbConstraints.weightx = 0;
    gbConstraints.gridwidth = 1;
    myRbModule = new JRadioButton(canAttach ? FindBundle.message("find.scope.project.radio") : FindBundle.message("find.scope.module.radio"), false);
    scopePanel.add(myRbModule, gbConstraints);
    myRbModule.addItemListener(resultsPreviewUpdateListener);
    gbConstraints.gridx = 1;
    gbConstraints.gridwidth = 2;
    gbConstraints.weightx = 1;
    Module[] modules = ModuleManager.getInstance(myProject).getModules();
    String[] names = new String[modules.length];
    for (int i = 0; i < modules.length; i++) {
        names[i] = modules[i].getName();
    }
    Arrays.sort(names, String.CASE_INSENSITIVE_ORDER);
    myModuleComboBox = new ComboBox(names);
    myModuleComboBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            scheduleResultsUpdate();
        }
    });
    scopePanel.add(myModuleComboBox, gbConstraints);
    if (modules.length == 1) {
        myModuleComboBox.setVisible(false);
        myRbModule.setVisible(false);
    }
    gbConstraints.gridx = 0;
    gbConstraints.gridy++;
    gbConstraints.weightx = 0;
    gbConstraints.gridwidth = 1;
    myRbDirectory = new JRadioButton(FindBundle.message("find.scope.directory.radio"), false);
    scopePanel.add(myRbDirectory, gbConstraints);
    myRbDirectory.addItemListener(resultsPreviewUpdateListener);
    gbConstraints.gridx = 1;
    gbConstraints.weightx = 1;
    myDirectoryComboBox = new ComboBox(200);
    Component editorComponent = myDirectoryComboBox.getEditor().getEditorComponent();
    if (editorComponent instanceof JTextField) {
        JTextField field = (JTextField) editorComponent;
        field.setColumns(40);
    }
    initCombobox(myDirectoryComboBox);
    myDirectoryComboBox.setSwingPopup(false);
    myDirectoryComboBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            scheduleResultsUpdate();
        }
    });
    scopePanel.add(myDirectoryComboBox, gbConstraints);
    gbConstraints.weightx = 0;
    gbConstraints.gridx = 2;
    mySelectDirectoryButton = new FixedSizeButton(myDirectoryComboBox);
    TextFieldWithBrowseButton.MyDoClickAction.addTo(mySelectDirectoryButton, myDirectoryComboBox);
    mySelectDirectoryButton.setMargin(new Insets(0, 0, 0, 0));
    scopePanel.add(mySelectDirectoryButton, gbConstraints);
    gbConstraints.gridx = 0;
    gbConstraints.gridy++;
    gbConstraints.weightx = 1;
    gbConstraints.gridwidth = 3;
    gbConstraints.insets = new Insets(0, 16, 0, 0);
    myCbWithSubdirectories = createCheckbox(true, FindBundle.message("find.scope.directory.recursive.checkbox"));
    myCbWithSubdirectories.setSelected(true);
    myCbWithSubdirectories.addItemListener(resultsPreviewUpdateListener);
    scopePanel.add(myCbWithSubdirectories, gbConstraints);
    gbConstraints.gridx = 0;
    gbConstraints.gridy++;
    gbConstraints.weightx = 0;
    gbConstraints.gridwidth = 1;
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    myRbCustomScope = new JRadioButton(FindBundle.message("find.scope.custom.radio"), false);
    scopePanel.add(myRbCustomScope, gbConstraints);
    gbConstraints.gridx++;
    gbConstraints.weightx = 1;
    gbConstraints.gridwidth = 2;
    myScopeCombo = new ScopeChooserCombo();
    myScopeCombo.init(myProject, true, true, FindSettings.getInstance().getDefaultScopeName(), new Condition<ScopeDescriptor>() {

        //final String projectFilesScopeName = PsiBundle.message("psi.search.scope.project");
        private final String moduleFilesScopeName;

        {
            String moduleScopeName = PsiBundle.message("search.scope.module", "");
            final int ind = moduleScopeName.indexOf(' ');
            moduleFilesScopeName = moduleScopeName.substring(0, ind + 1);
        }

        @Override
        public boolean value(ScopeDescriptor descriptor) {
            final String display = descriptor.getDisplay();
            return /*!projectFilesScopeName.equals(display) &&*/
            !display.startsWith(moduleFilesScopeName);
        }
    });
    myScopeCombo.getComboBox().addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            scheduleResultsUpdate();
        }
    });
    myRbCustomScope.addItemListener(resultsPreviewUpdateListener);
    Disposer.register(myDisposable, myScopeCombo);
    scopePanel.add(myScopeCombo, gbConstraints);
    ButtonGroup bgScope = new ButtonGroup();
    bgScope.add(myRbProject);
    bgScope.add(myRbModule);
    bgScope.add(myRbDirectory);
    bgScope.add(myRbCustomScope);
    myRbProject.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            validateScopeControls();
            validateFindButton();
        }
    });
    myRbCustomScope.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            validateScopeControls();
            validateFindButton();
            myScopeCombo.getComboBox().requestFocusInWindow();
        }
    });
    myRbDirectory.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            validateScopeControls();
            validateFindButton();
            myDirectoryComboBox.getEditor().getEditorComponent().requestFocusInWindow();
        }
    });
    myRbModule.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            validateScopeControls();
            validateFindButton();
            myModuleComboBox.requestFocusInWindow();
        }
    });
    mySelectDirectoryButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
            FileChooser.chooseFiles(descriptor, myProject, null, files -> myDirectoryComboBox.setSelectedItem(files.get(0).getPresentableUrl()));
        }
    });
    return scopePanel;
}
Also used : Language(com.intellij.lang.Language) FileUtilRt(com.intellij.openapi.util.io.FileUtilRt) UIUtil(com.intellij.util.ui.UIUtil) ReadTask(com.intellij.openapi.progress.util.ReadTask) VirtualFile(com.intellij.openapi.vfs.VirtualFile) ModalityState(com.intellij.openapi.application.ModalityState) Document(com.intellij.openapi.editor.Document) UniqueVFilePathBuilder(com.intellij.openapi.fileEditor.UniqueVFilePathBuilder) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) DocumentEvent(com.intellij.openapi.editor.event.DocumentEvent) TableCellRenderer(javax.swing.table.TableCellRenderer) SmartList(com.intellij.util.SmartList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) JBUI(com.intellij.util.ui.JBUI) Disposer(com.intellij.openapi.util.Disposer) DocumentAdapter(com.intellij.openapi.editor.event.DocumentAdapter) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) Logger(com.intellij.openapi.diagnostic.Logger) Module(com.intellij.openapi.module.Module) ListSelectionEvent(javax.swing.event.ListSelectionEvent) PatternSyntaxException(java.util.regex.PatternSyntaxException) ModuleUtilCore(com.intellij.openapi.module.ModuleUtilCore) DefaultTableModel(javax.swing.table.DefaultTableModel) PlainTextFileType(com.intellij.openapi.fileTypes.PlainTextFileType) com.intellij.ui(com.intellij.ui) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) JBScrollPane(com.intellij.ui.components.JBScrollPane) HelpManager(com.intellij.openapi.help.HelpManager) Nullable(org.jetbrains.annotations.Nullable) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) List(java.util.List) java.awt.event(java.awt.event) ApplicationManager(com.intellij.openapi.application.ApplicationManager) Registry(com.intellij.openapi.util.registry.Registry) Pattern(java.util.regex.Pattern) NotNull(org.jetbrains.annotations.NotNull) Ref(com.intellij.openapi.util.Ref) PsiBundle(com.intellij.psi.PsiBundle) FileChooserDescriptorFactory(com.intellij.openapi.fileChooser.FileChooserDescriptorFactory) ProgressIndicatorBase(com.intellij.openapi.progress.util.ProgressIndicatorBase) java.util(java.util) PsiFileFactory(com.intellij.psi.PsiFileFactory) ArrayUtil(com.intellij.util.ArrayUtil) ModuleManager(com.intellij.openapi.module.ModuleManager) UsageInfo(com.intellij.usageView.UsageInfo) ProgressIndicatorUtils(com.intellij.openapi.progress.util.ProgressIndicatorUtils) SearchScope(com.intellij.psi.search.SearchScope) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) Comparing(com.intellij.openapi.util.Comparing) STYLE_PLAIN(com.intellij.ui.SimpleTextAttributes.STYLE_PLAIN) CommonBundle(com.intellij.CommonBundle) UsagePreviewPanel(com.intellij.usages.impl.UsagePreviewPanel) Project(com.intellij.openapi.project.Project) PsiFile(com.intellij.psi.PsiFile) PropertyKey(org.jetbrains.annotations.PropertyKey) PsiDocumentManager(com.intellij.psi.PsiDocumentManager) StringUtil(com.intellij.openapi.util.text.StringUtil) com.intellij.usages(com.intellij.usages) Convertor(com.intellij.util.containers.Convertor) com.intellij.find(com.intellij.find) FileType(com.intellij.openapi.fileTypes.FileType) ProjectAttachProcessor(com.intellij.projectImport.ProjectAttachProcessor) JTextComponent(javax.swing.text.JTextComponent) Disposable(com.intellij.openapi.Disposable) java.awt(java.awt) com.intellij.openapi.actionSystem(com.intellij.openapi.actionSystem) JBTable(com.intellij.ui.table.JBTable) DumbAwareAction(com.intellij.openapi.project.DumbAwareAction) LanguageFileType(com.intellij.openapi.fileTypes.LanguageFileType) ScopeChooserCombo(com.intellij.ide.util.scopeChooser.ScopeChooserCombo) com.intellij.openapi.ui(com.intellij.openapi.ui) ShowUsagesAction(com.intellij.find.actions.ShowUsagesAction) UsageViewBundle(com.intellij.usageView.UsageViewBundle) ListSelectionListener(javax.swing.event.ListSelectionListener) FileChooser(com.intellij.openapi.fileChooser.FileChooser) TransactionGuard(com.intellij.openapi.application.TransactionGuard) Condition(com.intellij.openapi.util.Condition) Alarm(com.intellij.util.Alarm) javax.swing(javax.swing) ScopeChooserCombo(com.intellij.ide.util.scopeChooser.ScopeChooserCombo) JTextComponent(javax.swing.text.JTextComponent) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) Module(com.intellij.openapi.module.Module) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ScopeDescriptor

use of com.intellij.ide.util.scopeChooser.ScopeDescriptor in project intellij-plugins by JetBrains.

the class LiveObjectsView method setupUI.

private void setupUI() {
    liveObjectsTreeTable.getTree().setRootVisible(false);
    setColumnWidth(liveObjectsTreeTable.getColumnModel().getColumn(1), MS_COLUMN_WIDTH);
    setColumnWidth(liveObjectsTreeTable.getColumnModel().getColumn(2), MS_COLUMN_WIDTH);
    new TreeTableSpeedSearch(liveObjectsTreeTable).setComparator(new SpeedSearchComparator(false));
    PopupHandler.installPopupHandler(liveObjectsTreeTable, PROFILER_VIEW_GROUP_ID, ActionPlaces.UNKNOWN);
    liveObjectsTreeTable.getEmptyText().setText(ProfilerBundle.message("live.objects.loading"));
    liveObjectsTreeTable.getTree().setCellRenderer(new SizeInfoCellRenderer() {

        @Override
        public void customizeCellRenderer(Object value, boolean selected) {
            Icon icon = AllIcons.General.Information;
            if (value instanceof SizeInfoNode) {
                icon = ((SizeInfoNode) value).isMethod() ? AllIcons.Nodes.Method : AllIcons.Nodes.Class;
            }
            setPaintFocusBorder(false);
            setIcon(icon);
            super.customizeCellRenderer(value, selected);
        }
    });
    final ComboBoxModel model = filterScope.getComboBox().getModel();
    if (model instanceof DefaultComboBoxModel) {
        ((DefaultComboBoxModel) model).insertElementAt(new ScopeDescriptor(new AllSearchScope(getProject())), 0);
    }
}
Also used : TreeTableSpeedSearch(com.intellij.ui.TreeTableSpeedSearch) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) SizeInfoCellRenderer(com.jetbrains.actionscript.profiler.render.SizeInfoCellRenderer) AllSearchScope(com.jetbrains.actionscript.profiler.util.AllSearchScope) SizeInfoNode(com.jetbrains.actionscript.profiler.livetable.SizeInfoNode) SpeedSearchComparator(com.intellij.ui.SpeedSearchComparator)

Example 3 with ScopeDescriptor

use of com.intellij.ide.util.scopeChooser.ScopeDescriptor in project intellij-plugins by JetBrains.

the class CPUSnapshotView method setupUI.

private void setupUI() {
    myHotSpotsTreeTable.setRootVisible(false);
    myTracesTreeTable.setRootVisible(false);
    setColumnWidth(myHotSpotsTreeTable.getColumnModel().getColumn(1), MS_COLUMN_WIDTH);
    setColumnWidth(myHotSpotsTreeTable.getColumnModel().getColumn(2), MS_COLUMN_WIDTH);
    setColumnWidth(myTracesTreeTable.getColumnModel().getColumn(1), MS_COLUMN_WIDTH);
    setColumnWidth(myTracesTreeTable.getColumnModel().getColumn(2), MS_COLUMN_WIDTH);
    scopeLabel.setLabelFor(filterScope.getComboBox());
    invokedFunctionsLabel.setLabelFor(myHotSpotsTreeTable);
    mergedCalleesLabel.setLabelFor(myTracesTreeTable);
    new TreeTableSpeedSearch(myHotSpotsTreeTable).setComparator(new SpeedSearchComparator(false));
    new TreeTableSpeedSearch(myTracesTreeTable).setComparator(new SpeedSearchComparator(false));
    PopupHandler.installPopupHandler(myHotSpotsTreeTable, PROFILER_VIEW_GROUP_ID, ActionPlaces.UNKNOWN);
    PopupHandler.installPopupHandler(myTracesTreeTable, PROFILER_VIEW_GROUP_ID, ActionPlaces.UNKNOWN);
    final ComboBoxModel model = filterScope.getComboBox().getModel();
    if (model instanceof DefaultComboBoxModel) {
        ((DefaultComboBoxModel) model).insertElementAt(new ScopeDescriptor(new AllSearchScope(getProject())), 0);
    }
    myHotSpotsTreeTable.getTree().setCellRenderer(new FrameInfoCellRenderer(projectScope) {

        @Override
        public void customizeCellRenderer(Object value, boolean selected) {
            setPaintFocusBorder(false);
            setScopeIcon(FlexProfilerIcons.CallerArrow);
            setNonScopeIcon(FlexProfilerIcons.CallerLeafArrow);
            super.customizeCellRenderer(value, selected);
        }
    });
    myTracesTreeTable.getTree().setCellRenderer(new FrameInfoCellRenderer(projectScope) {

        @Override
        public void customizeCellRenderer(Object value, boolean selected) {
            setPaintFocusBorder(false);
            setScopeIcon(FlexProfilerIcons.CalleeArrow);
            setNonScopeIcon(FlexProfilerIcons.CalleeLeafArrow);
            super.customizeCellRenderer(value, selected);
        }
    });
    myFilterSystemStuff.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            buildPerformanceSamples(myHotSpotsTreeTable.getSortableTreeTableModel());
            TreeUtil.expand(myHotSpotsTreeTable.getTree(), 1);
        }
    });
    filterScope.getComboBox().addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            myAlarm.cancelAllRequests();
            myAlarm.addRequest(() -> {
                buildPerformanceSamples(myHotSpotsTreeTable.getSortableTreeTableModel());
                TreeUtil.expand(myHotSpotsTreeTable.getTree(), 1);
            }, 100);
        }
    });
}
Also used : TreeTableSpeedSearch(com.intellij.ui.TreeTableSpeedSearch) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) FrameInfoCellRenderer(com.jetbrains.actionscript.profiler.render.FrameInfoCellRenderer) ItemEvent(java.awt.event.ItemEvent) AllSearchScope(com.jetbrains.actionscript.profiler.util.AllSearchScope) ItemListener(java.awt.event.ItemListener) SpeedSearchComparator(com.intellij.ui.SpeedSearchComparator)

Example 4 with ScopeDescriptor

use of com.intellij.ide.util.scopeChooser.ScopeDescriptor in project intellij-community by JetBrains.

the class FindPopupScopeUIImpl method initComponents.

public void initComponents() {
    Module[] modules = ModuleManager.getInstance(myProject).getModules();
    String[] names = new String[modules.length];
    for (int i = 0; i < modules.length; i++) {
        names[i] = modules[i].getName();
    }
    Arrays.sort(names, String.CASE_INSENSITIVE_ORDER);
    myModuleComboBox = new ComboBox<>(names);
    ActionListener restartSearchListener = e -> scheduleResultsUpdate();
    myModuleComboBox.addActionListener(restartSearchListener);
    myDirectoryChooser = new FindPopupDirectoryChooser(myFindPopupPanel);
    myScopeCombo = new ScopeChooserCombo();
    myScopeCombo.init(myProject, true, true, FindSettings.getInstance().getDefaultScopeName(), new Condition<ScopeDescriptor>() {

        final String projectFilesScopeName = PsiBundle.message("psi.search.scope.project");

        final String moduleFilesScopeName;

        {
            String moduleScopeName = PsiBundle.message("search.scope.module", "");
            final int ind = moduleScopeName.indexOf(' ');
            moduleFilesScopeName = moduleScopeName.substring(0, ind + 1);
        }

        @Override
        public boolean value(ScopeDescriptor descriptor) {
            final String display = descriptor.getDisplay();
            return !projectFilesScopeName.equals(display) && !display.startsWith(moduleFilesScopeName);
        }
    });
    myScopeCombo.setBrowseListener(new ScopeChooserCombo.BrowseListener() {

        private FindModel myModelSnapshot;

        @Override
        public void onBeforeBrowseStarted() {
            myModelSnapshot = myHelper.getModel();
            myFindPopupPanel.getCanClose().set(false);
        }

        @Override
        public void onAfterBrowseFinished() {
            if (myModelSnapshot != null) {
                SearchScope scope = myScopeCombo.getSelectedScope();
                if (scope != null) {
                    myModelSnapshot.setCustomScope(scope);
                }
                myFindPopupPanel.getCanClose().set(true);
            }
        }
    });
    myScopeCombo.getComboBox().addActionListener(restartSearchListener);
    Disposer.register(myFindPopupPanel.getDisposable(), myScopeCombo);
}
Also used : ComboBox(com.intellij.openapi.ui.ComboBox) EmptyIcon(com.intellij.util.ui.EmptyIcon) Arrays(java.util.Arrays) ActionListener(java.awt.event.ActionListener) ModuleUtilCore(com.intellij.openapi.module.ModuleUtilCore) ModuleManager(com.intellij.openapi.module.ModuleManager) StringUtil(com.intellij.openapi.util.text.StringUtil) VirtualFile(com.intellij.openapi.vfs.VirtualFile) com.intellij.find(com.intellij.find) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) SearchScope(com.intellij.psi.search.SearchScope) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) java.awt(java.awt) Nullable(org.jetbrains.annotations.Nullable) ScopeChooserCombo(com.intellij.ide.util.scopeChooser.ScopeChooserCombo) Disposer(com.intellij.openapi.util.Disposer) Pair(com.intellij.openapi.util.Pair) Project(com.intellij.openapi.project.Project) Module(com.intellij.openapi.module.Module) NotNull(org.jetbrains.annotations.NotNull) ValidationInfo(com.intellij.openapi.ui.ValidationInfo) Condition(com.intellij.openapi.util.Condition) PsiBundle(com.intellij.psi.PsiBundle) javax.swing(javax.swing) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) ScopeChooserCombo(com.intellij.ide.util.scopeChooser.ScopeChooserCombo) ActionListener(java.awt.event.ActionListener) SearchScope(com.intellij.psi.search.SearchScope) Module(com.intellij.openapi.module.Module)

Aggregations

ScopeDescriptor (com.intellij.ide.util.scopeChooser.ScopeDescriptor)4 com.intellij.find (com.intellij.find)2 ScopeChooserCombo (com.intellij.ide.util.scopeChooser.ScopeChooserCombo)2 Module (com.intellij.openapi.module.Module)2 ModuleManager (com.intellij.openapi.module.ModuleManager)2 ModuleUtilCore (com.intellij.openapi.module.ModuleUtilCore)2 Project (com.intellij.openapi.project.Project)2 Condition (com.intellij.openapi.util.Condition)2 Disposer (com.intellij.openapi.util.Disposer)2 SpeedSearchComparator (com.intellij.ui.SpeedSearchComparator)2 TreeTableSpeedSearch (com.intellij.ui.TreeTableSpeedSearch)2 AllSearchScope (com.jetbrains.actionscript.profiler.util.AllSearchScope)2 CommonBundle (com.intellij.CommonBundle)1 ShowUsagesAction (com.intellij.find.actions.ShowUsagesAction)1 Language (com.intellij.lang.Language)1 Disposable (com.intellij.openapi.Disposable)1 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)1 ApplicationManager (com.intellij.openapi.application.ApplicationManager)1 ModalityState (com.intellij.openapi.application.ModalityState)1 TransactionGuard (com.intellij.openapi.application.TransactionGuard)1