当前位置: 首页>>代码示例>>Java>>正文


Java JLabel.setEnabled方法代码示例

本文整理汇总了Java中javax.swing.JLabel.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java JLabel.setEnabled方法的具体用法?Java JLabel.setEnabled怎么用?Java JLabel.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JLabel的用法示例。


在下文中一共展示了JLabel.setEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTableCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    JLabel component = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
    File file = (File)value;
    String displayNameText = (file != null) ? displayName.getDisplayName(file) : null;
    component.setText(displayNameText);
    if (!(table.getModel() instanceof ConfigFileSelectionTableModel)) {
        return component;
    }
    ConfigFileSelectionTableModel model = (ConfigFileSelectionTableModel)table.getModel();
    String toolTipText = null;
    if (!model.isEnabled(row)) {
        toolTipText = NbBundle.getMessage(ConfigFilesUIs.class, "LBL_FileAlreadyAdded");
    }
    component.setToolTipText(toolTipText);
    component.setEnabled(model.isEnabled(row));
    return component;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ConfigFilesUIs.java

示例2: getListCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    DisabledReason disabledReason = null;
    Object displayName = null;

    if (value instanceof Table) {
        Table tableItem = (Table)value;
        disabledReason = tableItem.getDisabledReason();
        if (disabledReason!= null) {
            displayName = NbBundle.getMessage(TableUISupport.class, "LBL_TableNameWithDisabledReason", tableItem.getName(), disabledReason.getDisplayName());
        } else {
            if(tableItem.isTable())
                displayName = tableItem.getName();
            else
                displayName = tableItem.getName() + NbBundle.getMessage(TableUISupport.class, "LBL_DB_VIEW");
        }
    }

    JLabel component = (JLabel)super.getListCellRendererComponent(list, displayName, index, isSelected, cellHasFocus);
    boolean needDisable = (disabledReason instanceof Table.NoPrimaryKeyDisabledReason) || (disabledReason instanceof Table.ExistingNotInSourceDisabledReason) || 
            (filter.equals(FilterAvailable.NEW) && (disabledReason instanceof Table.ExistingDisabledReason)) ||
            (filter.equals(FilterAvailable.UPDATE) && (disabledReason==null));
    component.setEnabled(!needDisable);
    component.setToolTipText(disabledReason != null ? disabledReason.getDescription() : null);

    return component;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:TableUISupport.java

示例3: getListCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                                              boolean cellHasFocus) {
    JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    renderer.setBorder(BorderFactory.createEmptyBorder(1, 7, 1, 5));

    if (value instanceof ProfilingPoint) {
        boolean enabled = ((ProfilingPoint) value).isEnabled();
        renderer.setText(((ProfilingPoint) value).getName());
        renderer.setIcon(enabled ? ((ProfilingPoint) value).getFactory().getIcon() :
                                   ((ProfilingPoint) value).getFactory().getDisabledIcon());
        renderer.setEnabled(enabled);
    } else if (value instanceof ProfilingPointFactory) {
        renderer.setText(((ProfilingPointFactory) value).getType());
        renderer.setIcon(((ProfilingPointFactory) value).getIcon());
        renderer.setEnabled(true);
    } else {
        renderer.setIcon(null);
        renderer.setEnabled(true);
    }

    return renderer;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:Utils.java

示例4: RefactoringPanelContainer

import javax.swing.JLabel; //导入方法依赖的package包/类
/** Creates new form RefactoringPanelContainer */
private RefactoringPanelContainer(String name, boolean isRefactoring) {
    setName(name);
    setToolTipText(name);
    setFocusable(true);
    setLayout(new java.awt.BorderLayout());
    setMinimumSize(new Dimension(1,1));
    getAccessibleContext().setAccessibleDescription(
        NbBundle.getMessage(RefactoringPanelContainer.class, "ACSD_usagesPanel")
    );
    pop = new JPopupMenu();
    pop.add(new Close());
    pop.add(new CloseAll());
    pop.add(new CloseAllButCurrent());
    listener = new PopupListener();
    closeL = new CloseListener();
    this.isRefactoring = isRefactoring;
    setFocusCycleRoot(true);
    JLabel label = new JLabel(NbBundle.getMessage(RefactoringPanelContainer.class, "LBL_NoUsages"));
    label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    label.setEnabled(false);
    this.add(label, BorderLayout.CENTER);
    initActions();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:RefactoringPanelContainer.java

示例5: PropertySheet

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Constructs a property sheet that shows the editable properties of a given
 * object.
 *
 * @param object the object whose properties are being edited
 */
public PropertySheet(Class[] types, Object[] values) {
    this.values = values;
    editors = new PropertyEditor[types.length];
    setLayout(new FormLayout());
    for (int i = 0; i < values.length; i++) {
        JLabel label = new JLabel(types[i].getName());
        add(label);
        if (Grid.class.isAssignableFrom(types[i])) {
            label.setEnabled(false);
            add(new JPanel());
        } else {
            editors[i] = getEditor(types[i]);
            if (editors[i] != null) {
                editors[i].setValue(values[i]);
                add(getEditorComponent(editors[i]));
            } else
                add(new JLabel("?"));
        }
    }
}
 
开发者ID:CBSkarmory,项目名称:AWGW,代码行数:27,代码来源:MenuMaker.java

示例6: initComponents

import javax.swing.JLabel; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    noResultsPanel = new JPanel();
    noResultsPanel.setLayout(new BorderLayout());
    noResultsPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));

    final JLabel noResultsLabel = new JLabel(NO_RESULTS_STRING);

    noResultsLabel.setFont(noResultsLabel.getFont().deriveFont(14));
    noResultsLabel.setEnabled(false);
    noResultsPanel.add(noResultsLabel, BorderLayout.NORTH);

    resultsTable = new JPanel(new CardLayout());
    resultsTable.add(noResultsLabel, "NORESULTS"); // NOI18N

    add(resultsTable, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:LiveFlatProfilePanel.java

示例7: createBottom

import javax.swing.JLabel; //导入方法依赖的package包/类
protected void createBottom()
{
	userHelp = new JLabel(CurrentLocale.get(
		"com.dytech.edge.admin.wizard.editor.rawhtmleditor.select", "\"{/xpath/to/my/data}\"")); //$NON-NLS-1$ //$NON-NLS-2$
	userRadio = new JRadioButton(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.rawhtmleditor.userdefined")); //$NON-NLS-1$
	userText = new I18nTextArea(BundleCache.getLanguages());

	Dimension d = new Dimension(0, 300);
	userText.setMinimumSize(d);
	userText.setPreferredSize(d);

	userText.setEnabled(false);
	userText.setEnabled(false);
	userHelp.setEnabled(false);
	userRadio.addActionListener(new RawHtmlEditor.RadioHandler(true));

	userPanel = new JPanel(new BorderLayout(5, 5));

	userPanel.add(userRadio, BorderLayout.NORTH);
	userPanel.add(userText, BorderLayout.CENTER);
	userPanel.add(userHelp, BorderLayout.SOUTH);
}
 
开发者ID:equella,项目名称:Equella,代码行数:23,代码来源:RawHtmlEditor.java

示例8: init

import javax.swing.JLabel; //导入方法依赖的package包/类
private void init() {
        initComponents();
        detailsPanel = new JPanel(new GridLayout(1, 1));
        Color color = Utils.getTextBackground();
        detailsPanel.setBackground(new Color(color.getRed(), color.getGreen(), color.getBlue()));
        lblEmptyDetails = new JLabel(NbBundle.getMessage(NotificationCenterTopComponent.class, "LBL_EmptyDetails"), JLabel.CENTER);
        lblEmptyDetails.setFont(italicFont);
        lblEmptyDetails.setEnabled(false);

        JScrollPane scrollPane = new JScrollPane(detailsPanel);
        splitPane.setRightComponent(scrollPane);

        toolBar.setFocusable(false);
        toolBar.setFloatable(false);
        btnSearch = new JToggleButton(ImageUtilities.loadImageIcon("org/netbeans/modules/notifications/resources/find16.png", true));
        btnSearch.setToolTipText(NbBundle.getMessage(NotificationCenterTopComponent.class, "LBL_SearchToolTip"));
        btnSearch.setFocusable(false);
        btnSearch.setSelected(NotificationSettings.isSearchVisible());
        //TODO delete 2 lines then quick search API clear text correctly
//        btnSearch.setToolTipText("Disabled due to Quick Search API defects");
//        btnSearch.setEnabled(false);
        btnSearch.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                setSearchVisible(btnSearch.isSelected());
            }
        });
        toolBar.add(btnSearch);
        toolBar.add(new FiltersMenuButton(notificationManager.getActiveFilter()));

        initLeft();
        showDetails();
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:NotificationCenterTopComponent.java

示例9: getTableCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  JLabel renderedLabel = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
  final BasicNode node = (BasicNode) tree.getPathForRow(row).getLastPathComponent();
  renderedLabel.setHorizontalAlignment(SwingConstants.CENTER);
  renderedLabel.setEnabled(!node.isSkip());
  renderedLabel.setForeground(EDITABLE_COLOR);
  return renderedLabel;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:9,代码来源:MassPieceLoader.java

示例10: GoToPanelImpl

import javax.swing.JLabel; //导入方法依赖的package包/类
/** Creates new form GoToPanel */
public GoToPanelImpl( ContentProvider contentProvider ) throws IOException {
    this.contentProvider = contentProvider;
    initComponents();
    containsScrollPane = true;
    ((AbstractDocument)nameField.getDocument()).setDocumentFilter(UiUtils.newUserInputFilter());
    matchesList.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
    matchesList.addListSelectionListener(null);

    Color bgColorBrighter = new Color(
                                Math.min(getBackground().getRed() + BRIGHTER_COLOR_COMPONENT, 255),
                                Math.min(getBackground().getGreen() + BRIGHTER_COLOR_COMPONENT, 255),
                                Math.min(getBackground().getBlue() + BRIGHTER_COLOR_COMPONENT, 255)
                        );

    messageLabel = new JLabel();
    messageLabel.setBackground(bgColorBrighter);
    messageLabel.setHorizontalAlignment(SwingConstants.CENTER);
    messageLabel.setEnabled(true);
    messageLabel.setText(NbBundle.getMessage(GoToPanelImpl.class, "TXT_NoSymbolsFound")); // NOI18N
    messageLabel.setFont(matchesList.getFont());

    // matchesList.setBackground( bgColorBrighter );
    // matchesScrollPane1.setBackground( bgColorBrighter );
    matchesList.setCellRenderer(
            contentProvider.getListCellRenderer(
            matchesList,
            caseSensitive.getModel()));
    contentProvider.setListModel( this, null );

    PatternListener pl = new PatternListener( this );
    nameField.getDocument().addDocumentListener(pl);
    matchesList.addListSelectionListener(pl);
    caseSensitive.setSelected(UiOptions.GoToSymbolDialog.getCaseSensitive());
    caseSensitive.addItemListener(pl);

    searchHistory = new SearchHistory(GoToPanelImpl.class, nameField);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:GoToPanelImpl.java

示例11: conciseHeaders

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Display the header area for the concise panel.
 *
 * @param market A {@code Market} to check goods arrears
 *     status with.
 */
private void conciseHeaders(Market market) {
    reportPanel.add(new JSeparator(JSeparator.HORIZONTAL),
                    "newline, span, growx");

    reportPanel.add(newLabel("report.colony.name.header", null, null,
                             stpld("report.colony.name")),
                    "newline");

    reportPanel.add(newLabel("report.colony.grow.header", null, null,
                             stpld("report.colony.grow")));
    reportPanel.add(newLabel("report.colony.explore.header", null, null,
                             stpld("report.colony.explore")));
    for (TileImprovementType ti : this.spec.getTileImprovementTypeList()) {
        if (ti.isNatural()) continue;
        String key = "report.colony.tile." + ti.getSuffix() + ".header";
        reportPanel.add(newLabel(key, null, null, stpld(key)));
    }
    for (GoodsType gt : this.goodsTypes) {
        ImageIcon icon = new ImageIcon(this.lib.getSmallIconImage(gt));
        JLabel l = newLabel(null, icon, null,
                            stpl("report.colony.production.header")
                                .addNamed("%goods%", gt));
        l.setEnabled(market == null || market.getArrears(gt) <= 0);
        reportPanel.add(l);
    }

    final UnitType type = spec.getDefaultUnitType(getMyPlayer());
    ImageIcon colonistIcon
        = new ImageIcon(this.lib.getTinyUnitImage(type, false));
    reportPanel.add(newLabel(null, colonistIcon, null,
                             stpld("report.colony.birth")));
    reportPanel.add(newLabel("report.colony.making.header", null, null,
                             stpld("report.colony.making")));
    reportPanel.add(newLabel("report.colony.improve.header", null, null,
                             stpld("report.colony.improve")));

    reportPanel.add(new JSeparator(JSeparator.HORIZONTAL),
                    "newline, span, growx");
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:46,代码来源:ReportCompactColonyPanel.java

示例12: getTableCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(
      JTable table,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column) {
      
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
String currentPanel = ((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.getCurrentPanel();

if (d == null) {
          label.setEnabled(false);
	label.setIcon(null);
          label.setBackground(new Color(212, 246, 246));
          return label;
      }
      
if (!isSelected) {
	CalendarDate cpsd = CurrentProject.get().getStartDate();
          CalendarDate cped = CurrentProject.get().getEndDate();
          if (!(((d.after(cpsd)) && (d.before(cped))) || (d.equals(cpsd)) || (d.equals(cped)))) {
		label.setBackground(new Color(212, 246, 246));
		return label;
	}
      }		


label.setHorizontalTextPosition(2);
label.setEnabled(true);



      if (d.equals(CalendarDate.today())) {
          label.setBorder(BorderFactory.createLineBorder(new Color(100, 100, 128)));
      }
      
// set foreground color
if (d.getCalendar().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
          label.setForeground(new Color(255, 0, 0));
      }
else { 		
	label.setForeground(Color.BLACK);
}

// set background color
if (currentPanel == null)
	label.setBackground(Color.WHITE);

else if (currentPanel.equals("TASKS") && (t != null) && 
	(d.inPeriod(t.getStartDate(), t.getEndDate()))) 
		label.setBackground(new Color(212, 246, 246));

else if(currentPanel.equals("NOTES") && 
CurrentProject.getNoteList().getNoteForDate(d) != null) 
			label.setBackground(new Color(212, 246, 246));

else if(currentPanel.equals("EVENTS") && 
(!(EventsManager.getEventsForDate(d).isEmpty()))) 
			label.setBackground(new Color(212, 246, 246));

else if(!isSelected)
	label.setBackground(Color.WHITE);
		
// always display NREvents
if (EventsManager.isNREventsForDate(d))
	label.setIcon(evIcon);
else
	label.setIcon(null);

      return label;
  }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:73,代码来源:JNCalendarCellRenderer.java

示例13: getTableCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
   * Based on panel selected show markings and content related to its 
   * duration in the calendar.
   */
  public Component getTableCellRendererComponent(
      JTable table,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column) {
  	
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
String currentPanel = ((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.getCurrentPanel();
if (d == null) {
          label.setEnabled(false);
	label.setIcon(null);
          label.setBackground(ColorMap.NULLDAY);
          return label;
      }
      
if (!isSelected) {
	CalendarDate cpsd = CurrentProject.get().getStartDate();
          CalendarDate cped = CurrentProject.get().getEndDate();
          if (!(((d.after(cpsd)) && (d.before(cped))) || (d.equals(cpsd)) || (d.equals(cped)))) {
		label.setBackground(ColorMap.NOPROJECT);
		return label;
	}
      }



label.setHorizontalTextPosition(2);
label.setEnabled(true);



      if (d.equals(CalendarDate.today())) {
          label.setBorder(BorderFactory.createLineBorder(ColorMap.TODAY));
      }
      
// set foreground color
if (d.getCalendar().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
          label.setForeground(ColorMap.SUNDAYTEXT);
      }
else { 		
	label.setForeground(ColorMap.DAYTEXT);
}

// set background color
if (currentPanel == null)
	label.setBackground(ColorMap.FREEBG);

else if (currentPanel.equals("TASKS") && (t != null) && 
	(d.inPeriod(t.getStartDate(), t.getEndDate()))) 
		label.setBackground(ColorMap.TASKBG);

else if(currentPanel.equals("NOTES") && 
CurrentProject.getNoteList().getNoteForDate(d) != null) 
			label.setBackground(ColorMap.NOTEBG);

else if(currentPanel.equals("EVENTS") && 
(!(EventsManager.getEventsForDate(d).isEmpty()))) 
			label.setBackground(ColorMap.EVENTBG);

else if(!isSelected)
	label.setBackground(ColorMap.FREEBG);
else {
	label.setBackground(ColorMap.DAYSELECT);
}
// always display NREvents
if (EventsManager.isNonRepeatingEventsForDate(d))
	label.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.PRIORITY_HIGH, 24, ColorMap.PRIORITY));
else
	label.setIcon(null);

      return label;
  }
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:79,代码来源:JNCalendarCellRenderer.java

示例14: getTableCellRendererComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(
      JTable table,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column) {
      
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
String currentPanel = ((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.getCurrentPanel();

if (d == null) {
          label.setEnabled(false);
	label.setIcon(null);
	PreferencesDialog.setJComponentBGandFG(label);
          return label;
      }
      
if (!isSelected) {
	CalendarDate cpsd = CurrentProject.get().getStartDate();
          CalendarDate cped = CurrentProject.get().getEndDate();
          if (!(((d.after(cpsd)) && (d.before(cped))) || (d.equals(cpsd)) || (d.equals(cped)))) {
		PreferencesDialog.setJComponentBGandFG(label);
		return label;
	}
      }		


label.setHorizontalTextPosition(2);
label.setEnabled(true);



      if (d.equals(CalendarDate.today())) {
          label.setBorder(BorderFactory.createLineBorder(new Color(100, 100, 128)));
      }
      
// set foreground color
if (d.getCalendar().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
          label.setForeground(new Color(255, 0, 0));
      }
else { 		
	label.setForeground(Color.BLACK);
}

// set background color
if (currentPanel == null)
	PreferencesDialog.setJComponentBGandFG(label);
else if (currentPanel.equals("TASKS") && (t != null) && 
	(d.inPeriod(t.getStartDate(), t.getEndDate()))) 
		label.setBackground( new Color(230, 255, 230));

else if(currentPanel.equals("NOTES") && 
CurrentProject.getNoteList().getNoteForDate(d) != null) 
			label.setBackground(new Color(255,245,200));

else if(currentPanel.equals("EVENTS") && 
(!(EventsManager.getEventsForDate(d).isEmpty()))) 
			label.setBackground(new Color(255,230,230));

else if(!isSelected)
	PreferencesDialog.setJComponentBGandFG(label);
		
// always display NREvents
if (EventsManager.isNREventsForDate(d))
	label.setIcon(evIcon);
else
	label.setIcon(null);

      return label;
  }
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:72,代码来源:JNCalendarCellRenderer.java

示例15: HierarchyTopComponent

import javax.swing.JLabel; //导入方法依赖的package包/类
@NbBundle.Messages({
    "TXT_NonActiveContent=<No View Available - Refresh Manually>",
    "TXT_InspectHierarchyHistory=<empty>",
    "TOOLTIP_RefreshContent=Refresh for entity under cursor",
    "TOOLTIP_OpenJDoc=Open Javadoc Window",
    "TOOLTIP_ViewHierarchyType=Hierachy View Type",
    "TOOLTIP_InspectHierarchyHistory=Inspect Hierarchy History"
})
public HierarchyTopComponent() {
    history = HistorySupport.getInstnace(this.getClass());
    jdocFinder = SelectJavadocTask.create(this);
    jdocTask = RP.create(jdocFinder);
    explorerManager = new ExplorerManager();
    rootChildren = new RootChildren();
    filters = new HierarchyFilters();
    explorerManager.setRootContext(Nodes.rootNode(rootChildren, filters));
    selectedNodes  = new InstanceContent();
    lookup = new AbstractLookup(selectedNodes);
    explorerManager.addPropertyChangeListener(this);
    initComponents();
    setName(Bundle.CTL_HierarchyTopComponent());
    setToolTipText(Bundle.HINT_HierarchyTopComponent());        
    viewTypeCombo = new JComboBox(new DefaultComboBoxModel(ViewType.values()));
    viewTypeCombo.setMinimumSize(new Dimension(MIN_TYPE_WIDTH,COMBO_HEIGHT));
    viewTypeCombo.addActionListener(this);
    viewTypeCombo.setToolTipText(Bundle.TOOLTIP_ViewHierarchyType());
    historyCombo = new JComboBox(HistorySupport.createModel(history, Bundle.TXT_InspectHierarchyHistory()));
    historyCombo.setMinimumSize(new Dimension(MIN_HISTORY_WIDTH,COMBO_HEIGHT));
    historyCombo.setRenderer(HistorySupport.createRenderer(history));
    historyCombo.addActionListener(this);
    historyCombo.setEnabled(false);
    historyCombo.getModel().addListDataListener(this);
    historyCombo.setToolTipText(Bundle.TOOLTIP_InspectHierarchyHistory());
    refreshButton = new JButton(ImageUtilities.loadImageIcon(REFRESH_ICON, true));
    refreshButton.addActionListener(this);
    refreshButton.setToolTipText(Bundle.TOOLTIP_RefreshContent());
    jdocButton = new JButton(ImageUtilities.loadImageIcon(JDOC_ICON, true));
    jdocButton.addActionListener(this);
    jdocButton.setToolTipText(Bundle.TOOLTIP_OpenJDoc());
    final Box upperToolBar = new MainToolBar(
        constrainedComponent(viewTypeCombo, GridBagConstraints.HORIZONTAL, 1.0, new Insets(0,0,0,0)),
        constrainedComponent(historyCombo, GridBagConstraints.HORIZONTAL, 1.5, new Insets(0,3,0,0)),
        constrainedComponent(refreshButton, GridBagConstraints.NONE, 0.0, new Insets(0,3,0,0)),
        constrainedComponent(jdocButton, GridBagConstraints.NONE, 0.0, new Insets(0,3,0,3)));
    add(decorateAsUpperPanel(upperToolBar), BorderLayout.NORTH);
    contentView = new JPanel();
    contentView.setLayout(new CardLayout());
    JPanel nonActiveContent = Utils.updateBackground(new JPanel());
    nonActiveContent.setLayout(new BorderLayout());
    nonActiveInfo = new JLabel(Bundle.TXT_NonActiveContent());
    nonActiveInfo.setEnabled(false);
    nonActiveInfo.setHorizontalAlignment(SwingConstants.CENTER);
    nonActiveContent.add(nonActiveInfo, BorderLayout.CENTER);
    btw = createBeanTreeView();
    contentView.add(nonActiveContent, NON_ACTIVE_CONTENT);
    contentView.add(btw, ACTIVE_CONTENT);
    add(contentView,BorderLayout.CENTER);
    lowerToolBar = new TapPanel();
    lowerToolBar.setOrientation(TapPanel.DOWN);
    final JComponent lowerButtons = filters.getComponent();
    lowerButtons.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0));
    lowerToolBar.add(lowerButtons);
    final boolean expanded = NbPreferences.forModule(HierarchyTopComponent.class).
            getBoolean(PROP_LOWER_TOOLBAR_EXPANDED, true); //NOI18N
    lowerToolBar.setExpanded(expanded);
    lowerToolBar.addPropertyChangeListener(this);
    add(Utils.updateBackground(lowerToolBar), BorderLayout.SOUTH);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:69,代码来源:HierarchyTopComponent.java


注:本文中的javax.swing.JLabel.setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。