cdt/cdt_6_0_x/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPaneFactory.java
author dadubrow
Tue, 17 Nov 2009 14:33:45 -0600
changeset 116 05ea843f7d56
parent 37 c2bce6dd59e7
permissions -rw-r--r--
Turn off DSF detail pane preference to allow other detail panes to be default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     1
/*******************************************************************************
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2007, 2008 Wind River Systems and others.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     3
 * All rights reserved. This program and the accompanying materials
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     4
 * are made available under the terms of the Eclipse Public License v1.0
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     5
 * which accompanies this distribution, and is available at
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     6
 * http://www.eclipse.org/legal/epl-v10.html
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     7
 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     8
 * Contributors:
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     9
 *     Wind River Systems, Inc. - initial implementation
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    10
 *******************************************************************************/
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    11
package org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.numberformat.detail;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    12
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    13
import java.util.HashSet;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    14
import java.util.Set;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    15
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    16
import org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.detailsupport.MessagesForDetailPane;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    17
import org.eclipse.debug.ui.IDetailPane;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    18
import org.eclipse.debug.ui.IDetailPaneFactory;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    19
import org.eclipse.jface.viewers.IStructuredSelection;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    20
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    21
/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    22
 *  This provides a simple Detail Pane Factory for the core debug views for DSF.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    23
 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    24
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    25
public class NumberFormatDetailPaneFactory implements IDetailPaneFactory {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    26
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    27
    /* (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    28
     * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#createDetailsArea(java.lang.String)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    29
     */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    30
    public IDetailPane createDetailPane(String id) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    31
        return new NumberFormatDetailPane();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    32
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    33
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    34
    /* (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    35
     * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDetailsTypes(org.eclipse.jface.viewers.IStructuredSelection)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    36
     */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    37
    @SuppressWarnings("unchecked")
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    38
    public Set getDetailPaneTypes(IStructuredSelection selection) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    39
        Set<String> possibleIDs = new HashSet<String>(1);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    40
        possibleIDs.add(NumberFormatDetailPane.ID);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    41
        return possibleIDs;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    42
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    43
    
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    44
    /* (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    45
     * @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(java.util.Set, org.eclipse.jface.viewers.IStructuredSelection)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    46
     */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    47
    public String getDefaultDetailPane(IStructuredSelection selection) {
116
05ea843f7d56 Turn off DSF detail pane preference to allow other detail panes to be default
dadubrow
parents: 37
diff changeset
    48
        return null; // allow competing detail pane factories to override this one
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    49
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    50
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    51
    /* (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    52
     * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getName(java.lang.String)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    53
     */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    54
    public String getDetailPaneName(String id) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    55
        if (id.equals(NumberFormatDetailPane.ID)){
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    56
            return MessagesForDetailPane.NumberFormatDetailPane_Name;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    57
        }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    58
        return null;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    59
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    60
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    61
    /* (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    62
     * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDescription(java.lang.String)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    63
     */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    64
    public String getDetailPaneDescription(String id) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    65
        if (id.equals(NumberFormatDetailPane.ID)){
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    66
            return MessagesForDetailPane.NumberFormatDetailPane_Description;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    67
        }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    68
        return null;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    69
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    70
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    71
}