Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IStatusLineManager


            tool.reset();
            IActionBars2 actionBars = tool.getContext().getActionBars();
            if (actionBars == null) {
                return null;
            }
            final IStatusLineManager statusBar = actionBars.getStatusLineManager();
            if (statusBar != null) {
                tool.getContext().updateUI(new Runnable(){
                    public void run() {
                        statusBar.setErrorMessage(null);
                        statusBar.setMessage(null);
                    }
                });

            }
        }
View Full Code Here


    }

    @Override
    public void setActive( boolean active ) {
        super.setActive(active);
        final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();
       
        disposeCommand();
       
        if (statusBar == null)
            return; // shouldn't happen if the tool is being used.
        getContext().updateUI(new Runnable(){
            public void run() {
                statusBar.setErrorMessage(null);
                statusBar.setMessage(null);
            }
        });
       
        if (active) {
            Control control = getContext().getViewportPane().getControl();
View Full Code Here

        return distance;
    }

   
    private void displayError() {
        final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();

        if (statusBar == null)
            return; // shouldn't happen if the tool is being used.

        getContext().updateUI(new Runnable(){
            public void run() {
                statusBar.setErrorMessage(Messages.DistanceTool_error);
            }
        });
    }
View Full Code Here

            }
        });
    }
   
    private void displayOnStatusBar( double distance ) {
        final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();

        if (statusBar == null)
            return; // shouldn't happen if the tool is being used.
        String units = UiPlugin.getDefault().getPreferenceStore().getString(org.locationtech.udig.ui.preferences.PreferenceConstants.P_DEFAULT_UNITS);
        if (units.equals( org.locationtech.udig.ui.preferences.PreferenceConstants.AUTO_UNITS) && CRSUtil.isCoordinateReferenceSystemImperial(context.getCRS())){
            units = org.locationtech.udig.ui.preferences.PreferenceConstants.IMPERIAL_UNITS;
        }
        final String message;
        if (units.equals( org.locationtech.udig.ui.preferences.PreferenceConstants.IMPERIAL_UNITS)){
            message = createMessageImperial(distance);
        }else{
            message = createMessageMetric(distance);
        }

        getContext().updateUI(new Runnable(){
            public void run() {
                statusBar.setErrorMessage(null);
                statusBar.setMessage(message);
            }
        });
    }
View Full Code Here

    public static void setStatusBarMessage( final IToolContext context, final String message ) {
        context.updateUI(new Runnable(){
            public void run() {
                if (context.getActionBars() == null)
                    return;
                IStatusLineManager bar = context.getActionBars().getStatusLineManager();
                if (bar != null) {
                    bar.setMessage(message);
                    bar.setErrorMessage(null);
                }
            }
        });
    }
View Full Code Here

    public static void setStatusErrorBarMessage( final IToolContext context, final String message ) {
        context.updateUI(new Runnable(){
            public void run() {
                if (context.getActionBars() == null)
                    return;
                IStatusLineManager bar = context.getActionBars().getStatusLineManager();
                if (bar != null) {
                    bar.setErrorMessage(message);
                    bar.setMessage(null);
                }
            }
        });
    }
View Full Code Here

    /**
     *
     * @param msg Display msg on status bar (if possible)
     */
    public void status(final String msg ) {
        final IStatusLineManager statusBar = getStatusBar();
        final Display display = Display.getCurrent();
       
        if( statusBar == null || display == null ) return;
       
        display.syncExec(new Runnable(){
            public void run(){
                statusBar.setMessage( msg);
            }
        });
    }
View Full Code Here

            list.add( n );
            final int len = list.size();

            getContext().getSelectedLayer().refresh( null );

            final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();
            if ( statusBar == null ) {
                return; // shouldn't happen if the tool is being used.
            }
            getContext().updateUI( new Runnable() {
                public void run() {
                    statusBar.setErrorMessage( null );
                    statusBar.setMessage( Long.toString( len ) + ". waypoint added, node=" + n.toString() );
                }
            } );
        }
    }
View Full Code Here

            } );
        }
    }

    private void displayError() {
        final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();

        if ( statusBar == null ) {
            return; // shouldn't happen if the tool is being used.
        }

        getContext().updateUI( new Runnable() {
            public void run() {
                statusBar.setErrorMessage( "Unable to calculate the distance" );
            }
        } );
    }
View Full Code Here

            }
        } );
    }

    private void displayOnStatusBar( double distance ) {
        final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();

        if ( statusBar == null ) {
            return; // shouldn't happen if the tool is being used.
        }
        int totalmeters = (int ) distance;
        final int km = totalmeters / 1000;
        final int meters = totalmeters - (km * 1000);
        float cm = (float ) (distance - totalmeters) * 10000;
        cm = Math.round( cm );
        final float finalcm = cm / 100;
        getContext().updateUI( new Runnable() {
            public void run() {
                statusBar.setErrorMessage( null );
                statusBar.setMessage( "Distance =  " + km + "," + meters + "m " + finalcm + "cm" );
            }
        } );
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.IStatusLineManager

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.