當前位置: 首頁>>代碼示例>>Java>>正文


Java ItemSelectable類代碼示例

本文整理匯總了Java中java.awt.ItemSelectable的典型用法代碼示例。如果您正苦於以下問題:Java ItemSelectable類的具體用法?Java ItemSelectable怎麽用?Java ItemSelectable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ItemSelectable類屬於java.awt包,在下文中一共展示了ItemSelectable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: add

import java.awt.ItemSelectable; //導入依賴的package包/類
public void add(JComponent c)
{
	if(c instanceof JTextComponent)
	{
		JTextComponent tc = (JTextComponent)c;
		tc.getDocument().addDocumentListener(this);
		tc.addPropertyChangeListener(PROPERTY_DOCUMENT, this);
	}
	else if(c instanceof ItemSelectable)
	{
		((ItemSelectable)c).addItemListener(this);
	}
	else
	{
		throw new Rex("ignored: " + c);
	}
}
 
開發者ID:andy-goryachev,項目名稱:PasswordSafe,代碼行數:18,代碼來源:InputTracker.java

示例2: getTreeCellEditorComponent

import java.awt.ItemSelectable; //導入依賴的package包/類
/**
 *
 * @param tree
 * @param value
 * @param selected
 * @param expanded
 * @param leaf
 * @param row
 * @return
 */
@Override
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected,
        boolean expanded, boolean leaf, int row) {

    Component editor = renderer.getTreeCellRendererComponent(tree, value, true, expanded, leaf,
            row, true);

    ItemListener itemListener = (ItemEvent itemEvent) -> {
        if (stopCellEditing()) {
            fireEditingStopped();
        }
    };
    if (editor instanceof JCheckBox) {
        ((ItemSelectable) editor).addItemListener(itemListener);
    }
    return editor;
}
 
開發者ID:CIRDLES,項目名稱:ET_Redux,代碼行數:28,代碼來源:CheckBoxNodeEditor.java

示例3: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Filter switch");

	BookDocument bookDocument = getActionFocusSelector().getActiveBookDocument();
	if (bookDocument == null) {
		logger.warn("Target document doesn't exist or is not a book");
		return;
	}

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);

	putValue(SELECTED_KEY, new Boolean(selected));
	AtomFilterChain chain = bookDocument.getFilterChain();
	if (selected != chain.isFilteringEnabled()) {
		chain = new AtomFilterChain(chain);
		chain.setFilteringEnabled(selected);
		bookDocument.setFilterChain(chain);
	}

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:25,代碼來源:BookFilterSwitchAction.java

示例4: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Filter switch");

	SignalDocument signalDocument = getActionFocusSelector().getActiveSignalDocument();
	if (signalDocument == null) {
		logger.warn("Target document doesn't exist or is not a signal");
		return;
	}

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);

	putValue(SELECTED_KEY, new Boolean(selected));
	Montage montage = signalDocument.getMontage();
	if (selected != montage.isFilteringEnabled()) {
		montage = new Montage(montage);
		montage.setFilteringEnabled(selected);
		signalDocument.setMontage(montage);
	}

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:25,代碼來源:SignalFilterSwitchAction.java

示例5: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Show main toolbar");

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
	if (viewFocusSelector == null) {
		logger.warn("No view selector");
		return;
	}
	View view = viewFocusSelector.getActiveView();
	if (view == null) {
		logger.warn("No view");
		return;
	}

	view.setMainToolBarVisible(selected);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:25,代碼來源:ShowMainToolBarAction.java

示例6: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Show left panel");

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
	if (viewFocusSelector == null) {
		return;
	}
	View view = viewFocusSelector.getActiveView();
	if (view == null) {
		return;
	}

	view.setLeftPanelVisible(selected);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:23,代碼來源:ShowLeftPanelAction.java

示例7: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Show bottom panel");

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
	if (viewFocusSelector == null) {
		return;
	}
	View view = viewFocusSelector.getActiveView();
	if (view == null) {
		return;
	}

	view.setBottomPanelVisible(selected);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:23,代碼來源:ShowBottomPanelAction.java

示例8: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Maximize documents");

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
	if (viewFocusSelector == null) {
		return;
	}
	View view = viewFocusSelector.getActiveView();
	if (view == null) {
		return;
	}

	view.setViewMode(selected);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:23,代碼來源:ViewModeAction.java

示例9: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Show status bar");

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
	if (viewFocusSelector == null) {
		return;
	}
	View view = viewFocusSelector.getActiveView();
	if (view == null) {
		return;
	}

	view.setStatusBarVisible(selected);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:23,代碼來源:ShowStatusBarAction.java

示例10: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {

	logger.debug("Snap to page");

	SignalDocument signalDocument = getActionFocusSelector().getActiveSignalDocument();
	if (signalDocument == null) {
		logger.warn("Target document doesn't exist or is not a signal");
		return;
	}

	SignalView view = (SignalView) signalDocument.getDocumentView();

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	view.setSnapToPageMode(selected);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:22,代碼來源:SnapToPageAction.java

示例11: actionPerformed

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent ev) {
	SignalDocument signalDocument = getActionFocusSelector().getActiveSignalDocument();
	if (signalDocument == null) {
		logger.warn("Target document doesn't exist or is not a signal");
		return;
	}

	SignalView view = (SignalView) signalDocument.getDocumentView();

	ItemSelectable button = (ItemSelectable) ev.getSource();
	Object[] selectedObjects = button.getSelectedObjects();
	boolean selected = (selectedObjects != null && selectedObjects.length != 0);
	putValue(SELECTED_KEY, new Boolean(selected));

	view.setDisplayClockTime(selected);
}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:18,代碼來源:DisplayClockTimeAction.java

示例12: itemStateChanged

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
public void itemStateChanged(ItemEvent e) {
    ItemSelectable is = e.getItemSelectable();
    if (is == matchCase) {
        matchCaseChanged();
    } else if (is == textToFindType) {
        regexpChanged();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:BasicSearchForm.java

示例13: itemStateChanged

import java.awt.ItemSelectable; //導入依賴的package包/類
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
 
開發者ID:tiweGH,項目名稱:OpenDiabetes,代碼行數:37,代碼來源:Transfer.java

示例14: subscribeActual

import java.awt.ItemSelectable; //導入依賴的package包/類
@Override
protected void subscribeActual(Observer<? super ItemEvent> observer) {
    ItemSelectable w = widget;

    ItemEventConsumer aec = new ItemEventConsumer(observer, w);
    observer.onSubscribe(aec);

    w.addItemListener(aec);
    if (aec.get() == null) {
        aec.onDispose(w);
    }
}
 
開發者ID:akarnokd,項目名稱:RxJava2Swing,代碼行數:13,代碼來源:ItemEventObservable.java

示例15: postMenuActionEvent

import java.awt.ItemSelectable; //導入依賴的package包/類
/**
 * Called from the signal handler of the gtk widget.  Posts a
 * ItemEvent to indicate a state changed, then calls super to post
 * an ActionEvent.
 */
protected void postMenuActionEvent ()
{
  CheckboxMenuItem item = (CheckboxMenuItem)awtWidget;
  q().postEvent (new ItemEvent ((ItemSelectable)awtWidget,
    ItemEvent.ITEM_STATE_CHANGED,
    item.getActionCommand(),
    item.getState() ? ItemEvent.DESELECTED : ItemEvent.SELECTED));

  super.postMenuActionEvent();
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:16,代碼來源:GtkCheckboxMenuItemPeer.java


注:本文中的java.awt.ItemSelectable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。