Package org.openide.windows

Examples of org.openide.windows.TopComponent


    /**
     * Obtain the LilyPondViewTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized LilyPondViewTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(LilyPondViewTopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here


    /**
     * Obtain the LilyPropertiesTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized LilyPropertiesTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(LilyPropertiesTopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here

    public BytecodeViewAction() {
        super(NbBundle.getMessage(BytecodeViewAction.class, "CTL_BytecodeViewAction"));
    }

    public void actionPerformed(ActionEvent evt) {
        TopComponent win = BytecodeViewTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
View Full Code Here

    /**
     * Obtain the BytecodeViewTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized BytecodeViewTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            ErrorManager.getDefault().log(ErrorManager.WARNING, "Cannot find BytecodeView component. It will not be located properly in the window system.");
            return getDefault();
        }
        if (win instanceof BytecodeViewTopComponent) {
View Full Code Here

    public OutlineAction() {
        super(NbBundle.getMessage(OutlineAction.class, "CTL_OutlineAction"));
    }

    public void actionPerformed(ActionEvent evt) {
        TopComponent win = OutlineTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
View Full Code Here

     */
    public static Project getActiveProject() {
        FileObject fo;

        try {
            TopComponent tc = TopComponent.getRegistry().getActivated();

            DataObject mainDataObj = tc.getLookup().lookup(DataObject.class);
            fo = mainDataObj.getPrimaryFile();
            Project proj = FileOwnerQuery.getOwner(fo);
    
            return proj;
        } catch (Exception e) {
View Full Code Here

    /**
     * Obtain the ReplTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized ReplTopComponent findInstance() {
        String ideReplID = PREFERRED_ID_prefix + IDE_REPL;
        TopComponent win = WindowManager.getDefault().findTopComponent(ideReplID);
        if (win == null) {
            LOG.log(Level.WARNING, "Cannot find " + ideReplID +
                    " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here

        @Override
        public void actionPerformed ( ActionEvent e ) {
            try {
                JsonPanel jp = new JsonPanel( fo );
                DataObject dob = DataObject.find( fo );
                TopComponent tc = new TopComponent( dob.getLookup() ) {
                    @Override
                    public int getPersistenceType () {
                        return TopComponent.PERSISTENCE_NEVER;
                    }
                };
                tc.setDisplayName( fo.getParent().getName() );
                tc.setLayout( new BorderLayout() );
                JScrollPane ssc = new JScrollPane( jp );
                ssc.setBorder( BorderFactory.createEmptyBorder() );
                ssc.setViewportBorder( BorderFactory.createEmptyBorder() );
                tc.add( ssc, BorderLayout.CENTER );
                tc.open();
                tc.requestActive();
            } catch ( Exception ex ) {
                //already logged
            }
        }
View Full Code Here

    /**
     * Obtain the LilyPreviewTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized LilyPreviewTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(LilyPreviewTopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here

    /**
     * Obtain the LilyPondViewTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized LilyPondViewTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(LilyPondViewTopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here

TOP

Related Classes of org.openide.windows.TopComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.