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


Java OutlineModel.hasSelection方法代碼示例

本文整理匯總了Java中com.trollworks.toolkit.ui.widget.outline.OutlineModel.hasSelection方法的典型用法代碼示例。如果您正苦於以下問題:Java OutlineModel.hasSelection方法的具體用法?Java OutlineModel.hasSelection怎麽用?Java OutlineModel.hasSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.trollworks.toolkit.ui.widget.outline.OutlineModel的用法示例。


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

示例1: getTarget

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
private static HasSourceReference getTarget() {
    HasSourceReference ref = null;
    Component comp = getFocusOwner();
    if (comp instanceof Outline) {
        OutlineModel model = ((Outline) comp).getModel();
        if (model.hasSelection()) {
            Selection selection = model.getSelection();
            if (selection.getCount() == 1) {
                Row row = model.getFirstSelectedRow();
                if (row instanceof HasSourceReference) {
                    ref = (HasSourceReference) row;
                }
            }
        }
    }
    return ref;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:18,代碼來源:OpenPageReferenceCommand.java

示例2: canDeleteSelection

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public boolean canDeleteSelection() {
    OutlineModel model = getModel();
    boolean can = mAddButton.isEnabled() && model.hasSelection();
    if (can) {
        for (Modifier row : new FilteredIterator<>(model.getSelectionAsList(), Modifier.class)) {
            if (row.isReadOnly()) {
                return false;
            }
        }
    }
    return can;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:14,代碼來源:ModifierListEditor.java

示例3: actionPerformed

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
    Component focus = getFocusOwner();
    if (focus instanceof OutlineProxy) {
        focus = ((OutlineProxy) focus).getRealOutline();
    }
    ListOutline outline = (ListOutline) focus;
    OutlineModel model = outline.getModel();
    if (!model.isLocked() && model.hasSelection()) {
        ArrayList<Row> rows = new ArrayList<>();
        ArrayList<Row> topRows = new ArrayList<>();
        DataFile dataFile = outline.getDataFile();
        dataFile.startNotify();
        model.setDragRows(model.getSelectionAsList(true).toArray(new Row[0]));
        outline.convertDragRowsToSelf(rows);
        model.setDragRows(null);
        for (Row row : rows) {
            if (row.getDepth() == 0) {
                topRows.add(row);
            }
        }
        outline.addRow(topRows.toArray(new ListRow[0]), DUPLICATE_UNDO, true);
        dataFile.endNotify();
        model.select(topRows, false);
        outline.scrollSelectionIntoView();
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:28,代碼來源:DuplicateCommand.java

示例4: actionPerformed

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
    LibraryDockable library = getTarget(LibraryDockable.class);
    if (library != null) {
        OutlineModel outlineModel = library.getOutline().getModel();
        if (outlineModel.hasSelection()) {
            SheetDockable sheet = SheetDockable.getLastActivated();
            if (sheet != null) {
                sheet.addRows(outlineModel.getSelectionAsList(true));
            }
        }
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:14,代碼來源:CopyToSheetCommand.java

示例5: actionPerformed

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
    LibraryDockable library = getTarget(LibraryDockable.class);
    if (library != null) {
        OutlineModel outlineModel = library.getOutline().getModel();
        if (outlineModel.hasSelection()) {
            TemplateDockable template = TemplateDockable.getLastActivated();
            if (template != null) {
                template.addRows(outlineModel.getSelectionAsList(true));
            }
        }
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:14,代碼來源:CopyToTemplateCommand.java

示例6: canDeleteSelection

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public boolean canDeleteSelection() {
    OutlineModel model = getModel();
    return !model.isLocked() && model.hasSelection();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:6,代碼來源:ListOutline.java


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