Java Code Examples for org.openide.awt.UndoRedo#NONE

The following examples show how to use org.openide.awt.UndoRedo#NONE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProductSceneViewTopComponent.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
public ProductSceneViewTopComponent(ProductSceneView view, UndoRedo undoRedo) {
        super(view.getRaster());
        this.view = view;
        this.undoRedo = undoRedo != null ? undoRedo : UndoRedo.NONE;
        this.nodeRenameHandler = new NodeRenameHandler();
        this.selection = Selection.EMPTY;
        setToolTipText(view.getRaster().getDescription());
        setIcon(ImageUtilities.loadImage("org/esa/snap/rcp/icons/RsBandAsSwath.gif"));
        updateDisplayName();
        setName(getDisplayName());
/*
        // checkme - this is ugly and not wanted (nf), the node will either passed in or we'll have
        // a central node factory, e.g. via an ExtensionObject
        Node node = null;
        try {
            if (raster instanceof Mask) {
                node = new MNode((Mask) raster, undoRedo);
            } else if (raster instanceof Band) {
                node = new BNode((Band) raster, undoRedo);
            } else if (raster instanceof TiePointGrid) {
                node = new TPGNode((TiePointGrid) raster, undoRedo);
            }
        } catch (IntrospectionException e) {
            Exceptions.printStackTrace(e);
        }
        if (node != null) {
            setActivatedNodes(new Node[]{node});
        }
*/
        setLayout(new BorderLayout());
        add(new JLayer<>(this.view, new ProductSceneViewLayerUI()), BorderLayout.CENTER);
    }
 
Example 2
Source File: PlacemarkManagerTopComponent.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    if (product != null) {
        return snapApp.getUndoManager(getProduct());
    }
    return UndoRedo.NONE;
}
 
Example 3
Source File: NavigatorTC.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    if (selectedPanel == null || !(selectedPanel instanceof NavigatorPanelWithUndo)) {
        return UndoRedo.NONE;
    }
    return ((NavigatorPanelWithUndo)selectedPanel).getUndoRedo();
}
 
Example 4
Source File: ComponentInspector.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    if (formDesigner != null) {
        FormModel formModel = formDesigner.getFormModel();
        if (formModel != null) {
            UndoRedo ur = formModel.getUndoRedoManager();
            if (ur != null) {
                return ur;
            }
        }
    }
    return UndoRedo.NONE;
}
 
Example 5
Source File: DelegatingUndoRedo.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void setDiffView(JComponent componentDelegate) {
    if (componentDelegate == null) {
        setDelegate(UndoRedo.NONE);
    } else {
        if (comp != null) {
            comp.removePropertyChangeListener(this);
        }
        comp = componentDelegate;
        comp.addPropertyChangeListener(this);
        UndoRedo delegate = (UndoRedo) componentDelegate.getClientProperty(UndoRedo.class);
        if (delegate == null) delegate = UndoRedo.NONE; 
        setDelegate(delegate);
    }
}
 
Example 6
Source File: ProjectTab.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    final UndoRedo undoRedo = Lookups.forPath("org/netbeans/modules/refactoring").lookup(UndoRedo.class);
    return undoRedo==null?UndoRedo.NONE:undoRedo;
}
 
Example 7
Source File: TableDataView.java    From BART with MIT License 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 8
Source File: DB_VMDGraphPanel.java    From BART with MIT License 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 9
Source File: InfoDB.java    From BART with MIT License 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 10
Source File: HtmlPreviewElement.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 11
Source File: LazyPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override public UndoRedo getUndoRedo() {
    NavigatorPanel p = initialize();
    return p instanceof NavigatorPanelWithUndo ? ((NavigatorPanelWithUndo) p).getUndoRedo() : UndoRedo.NONE;
}
 
Example 12
Source File: DiffSidebar.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    UndoRedo undoredo = (UndoRedo) diffView.getClientProperty(UndoRedo.class);
    return undoredo == null ? UndoRedo.NONE : undoredo;
}
 
Example 13
Source File: UndoAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Finds current undo/redo.
*/
static UndoRedo getUndoRedo() {
    TopComponent el = WindowManager.getDefault().getRegistry().getActivated();

    return (el == null) ? UndoRedo.NONE : el.getUndoRedo();
}
 
Example 14
Source File: ToolbarVisibleTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 15
Source File: MultiViewPeer.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private UndoRedo privateGetUndoRedo() {
    return model.getActiveElement().getUndoRedo() != null ? model.getActiveElement().getUndoRedo() : UndoRedo.NONE;
}
 
Example 16
Source File: FormDesignerTC.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    UndoRedo.Provider provider = getLookup().lookup(UndoRedo.Provider.class);
    return (provider == null) ? UndoRedo.NONE : provider.getUndoRedo();
}
 
Example 17
Source File: ClassMemberPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public UndoRedo getUndoRedo() {
    final UndoRedo undoRedo = Lookups.forPath("org/netbeans/modules/refactoring").lookup(UndoRedo.class);
    return undoRedo==null?UndoRedo.NONE:undoRedo;
}
 
Example 18
Source File: EffectivePomMD.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 19
Source File: BasicPomMD.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}
 
Example 20
Source File: TopComponent.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/** Get the undo/redo support for this component.
* The default implementation returns a dummy support that cannot
* undo anything.
*
* @return undoable edit for this component
*/
public UndoRedo getUndoRedo() {
    return UndoRedo.NONE;
}