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


Java MultiViewElement类代码示例

本文整理汇总了Java中org.netbeans.core.spi.multiview.MultiViewElement的典型用法代码示例。如果您正苦于以下问题:Java MultiViewElement类的具体用法?Java MultiViewElement怎么用?Java MultiViewElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: MultiViewModel

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
/**
     * constructor used at deserialization...
     */
    MultiViewModel(MultiViewDescription[] descs, MultiViewDescription defaultDescr, 
                   MultiViewModel.ActionRequestObserverFactory factory, Map<MultiViewDescription, MultiViewElement> existingElements) {
        observerFactory = factory;
        nestedElements = new HashMap<MultiViewDescription, MultiViewElement>();
//        nestedPerspectiveComponents = new HashMap();
        nestedPerspectives = new HashMap<MultiViewDescription,MultiViewPerspective>();
        nestedCallbacks = new HashMap<MultiViewElement, MultiViewElementCallback>();
        shownElements = new HashSet<MultiViewElement>(descs.length + 3);
        descriptions = descs;
        for (int i = 0; i < descriptions.length; i++) {
            MultiViewElement element = existingElements.get(descriptions[i]);
            nestedElements.put(descriptions[i], element);
            nestedPerspectives.put(descriptions[i], Accessor.DEFAULT.createPerspective(descriptions[i]));
            if (element != null) {
                // set the observer..
                MultiViewElementCallback call = factory.createElementCallback(descriptions[i]);
                nestedCallbacks.put(element, call);
                element.setMultiViewCallback(call);
//                nestedPerspectiveComponents.put(descriptions[i], Accessor.DEFAULT.createPersComponent(element));
            }
        }
        currentEditor = (defaultDescr == null || !nestedElements.containsKey(defaultDescr) ? descriptions[0] : defaultDescr);
        group = new BtnGroup();
	groupSplit = new BtnGroup();
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:MultiViewModel.java

示例2: addPropertyChangeListeners

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
private void addPropertyChangeListeners() {
    if( null != model ) {
        for (MultiViewDescription mvd : model.getDescriptions()) {
            if( mvd instanceof ContextAwareDescription && ((ContextAwareDescription)mvd).isSplitDescription() )
                continue; //#240371 - don't update name from spit elements
            
            MultiViewElement el = model.getElementForDescription( mvd, false );
            if (el == null) {
                continue;
            }
            if (el.getVisualRepresentation() instanceof Pane) {
                Pane pane = (Pane)el.getVisualRepresentation();
                final CloneableTopComponent tc = pane.getComponent();
                if (!Arrays.asList(tc.getPropertyChangeListeners()).contains(propListener)) {
                    tc.addPropertyChangeListener(propListener);
                }
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:MultiViewPeer.java

示例3: updateName

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
public void updateName() {
    // is called before setMultiViewDescriptions() need to check for null.
    if (model != null) {
        for (MultiViewDescription mvd : model.getDescriptions()) {
            if( mvd instanceof ContextAwareDescription && ((ContextAwareDescription)mvd).isSplitDescription() )
                continue; //#240371 - don't update name from spit elements
            
            MultiViewElement el = model.getElementForDescription(
                mvd, MultiViewCloneableTopComponent.isSourceView(mvd)
            );
            if (el == null) {
                continue;
            }
            if (el.getVisualRepresentation() instanceof Pane) {
                Pane pane = (Pane)el.getVisualRepresentation();
                pane.updateName();
                final CloneableTopComponent tc = pane.getComponent();
                peer.setDisplayName(tc.getDisplayName());
                peer.setIcon(tc.getIcon());
                if (!Arrays.asList(tc.getPropertyChangeListeners()).contains(propListener)) {
                    tc.addPropertyChangeListener(propListener);
                }
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:MultiViewPeer.java

示例4: createXmlMultiViewElement

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
@MultiViewElement.Registration(
    mimeType=PUDataLoader.REQUIRED_MIME,
    iconBase=ICON,
    persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED,
    preferredID=PREFERRED_ID_SOURCE,
    displayName="#CTL_SourceTabCaption",
    position=2000
)
@Messages("CTL_SourceTabCaption=Source")
public static XmlMultiViewElement createXmlMultiViewElement(Lookup lookup) {
    return new XmlMultiViewElement(lookup.lookup(XmlMultiViewDataObject.class));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:PUDataObject.java

示例5: createMultiViewEditorElement

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
@MultiViewElement.Registration(
    displayName="#CTL_SourceTabCaption",
    iconBase="org/apache/tools/ant/module/resources/AntIcon.gif",
    persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED,
    preferredID="ant",
    mimeType=MIME_TYPE,
    position=1
)
@Messages("CTL_SourceTabCaption=&Source")
public static MultiViewEditorElement createMultiViewEditorElement(Lookup context) {
    return new MultiViewEditorElement(context);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:AntProjectDataObject.java

示例6: getCreatedElements

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
/**
 * returns all elements that were so far created/instantiated.
 */
synchronized Collection getCreatedElements() {
   Collection<MultiViewElement> col = new ArrayList<MultiViewElement>(nestedElements.size());
   for (Map.Entry<MultiViewDescription, MultiViewElement> entry : nestedElements.entrySet()) {
       if (entry.getValue() != null) {
           col.add(entry.getValue());
       }
       
   }
   return col;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:MultiViewModel.java

示例7: getElementForDescription

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
/**
    * used primarily at deserialization time.
    */
    synchronized MultiViewElement getElementForDescription(MultiViewDescription description, boolean create) {
       MultiViewElement element = nestedElements.get(description);
       if (element == null && create) {
           element = description.createElement();
           MultiViewElementCallback call = observerFactory.createElementCallback(description);
           nestedCallbacks.put(element, call);
           element.setMultiViewCallback(call);
           nestedElements.put(description, element);
//           nestedPerspectiveComponents.put(description, Accessor.DEFAULT.createPersComponent(element));
       }
       return element;
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:MultiViewModel.java

示例8: _setMultiViewDescriptions

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
private void _setMultiViewDescriptions(MultiViewDescription[] descriptions, MultiViewDescription defaultDesc) {
    Map<MultiViewDescription, MultiViewElement> createdElements = Collections.emptyMap();
    if (model != null) {
        model.removeElementSelectionListener(selListener);
        createdElements = model.getCreatedElementsMap();
    }
    model = new MultiViewModel(descriptions, defaultDesc, factory, createdElements);
    model.addElementSelectionListener(selListener);
    tabs.setModel(model);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:MultiViewPeer.java

示例9: setDeserializedMultiViewDescriptions

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
void setDeserializedMultiViewDescriptions(int splitOrientation, MultiViewDescription[] descriptions,
      MultiViewDescription defaultDesc, MultiViewDescription defaultDescSplit, Map<MultiViewDescription, MultiViewElement> existingElements) {
       if (model != null) {
           model.removeElementSelectionListener(selListener);
       }
// if Design view was active before closing, set default to Source view
if( splitOrientation != -1 )
           defaultDescSplit = defaultDescSplit.getDisplayName().startsWith("&Design") ? descriptions[1] : defaultDescSplit; //NOI18N
       model = new MultiViewModel(descriptions, defaultDesc, factory, existingElements);
       model.addElementSelectionListener(selListener);
tabs.setModel(model);
this.initialSplitOrientation = splitOrientation;
       this.initialSplitDescription = defaultDescSplit;
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:MultiViewPeer.java

示例10: assignLookup

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
final void assignLookup(MultiViewTopComponentLookup lkp) {
    if (lkp.isInitialized()) {
        return;
    }
    final MultiViewElement el = getModel().getActiveElement();
    if (el != null) {
        assignLookup(el, lkp);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:MultiViewPeer.java

示例11: peerComponentClosed

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
void peerComponentClosed() {
    Iterator it = model.getCreatedElements().iterator();
    while (it.hasNext()) {
        MultiViewElement el = (MultiViewElement)it.next();
        model.markAsHidden(el);
        el.componentClosed();
    }
    tabs.peerComponentClosed();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:MultiViewPeer.java

示例12: getEditorPane

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
JEditorPane getEditorPane() {
    if (model != null) {
        MultiViewElement el = model.getActiveElement();
        if (el != null && el.getVisualRepresentation() instanceof Pane) {
            Pane pane = (Pane)el.getVisualRepresentation();
            return pane.getEditorPane();
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:MultiViewPeer.java

示例13: selectionChanged

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
public void selectionChanged(MultiViewDescription oldOne, MultiViewDescription newOne) {
    if (isActivated()) {
        MultiViewElement el = model.getElementForDescription(oldOne);
        el.componentDeactivated();
    }
    hideElement(oldOne);
    showCurrentElement();
    delegateUndoRedo.updateListeners(model.getElementForDescription(oldOne),
                                     model.getElementForDescription(newOne));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:MultiViewPeer.java

示例14: updateListeners

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
void updateListeners(MultiViewElement old, MultiViewElement fresh) {
    Iterator it = listeners.iterator();
    while (it.hasNext()) {
        ChangeListener elem = (ChangeListener) it.next();
        if (old.getUndoRedo() != null) {
            old.getUndoRedo().removeChangeListener(elem);
        }
        if (fresh.getUndoRedo() != null) {
            fresh.getUndoRedo().addChangeListener(elem);
        }
    }
    fireElementChange();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:MultiViewPeer.java

示例15: getEditorPane

import org.netbeans.core.spi.multiview.MultiViewElement; //导入依赖的package包/类
public javax.swing.JEditorPane getEditorPane() {
    if (peer == null || peer.model == null) {
        return null;
    }
    MultiViewElement paneEl = findPaneElement();
    if (paneEl != null) {
        CloneableEditorSupport.Pane pane = (CloneableEditorSupport.Pane)paneEl.getVisualRepresentation();
        return pane.getEditorPane();
    }
    // hopeless case, don't try to create new elements. it's users responsibility to
    // switch to the editor element before getEditorPane() 
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:MultiViewCloneableTopComponent.java


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