public void update() { Rectangle rect = toolBar.getBounds(); if ( connectDropdown != null && !connectDropdown.isDisposed() ) { if ( spoon.rep != null ) { StringBuilder connectionLabel = new StringBuilder(); if ( spoon.rep.getUserInfo() != null ) { connectionLabel.append( spoon.rep.getUserInfo().getLogin() ); connectionLabel.append( " | " ); } StringBuilder connectionLabelTip = new StringBuilder( connectionLabel.toString() ); if ( repoConnectController != null && repoConnectController.getConnectedRepository() != null ) { connectionLabel.append( truncateName( spoon.getRepositoryName() ) ); connectionLabelTip.append( spoon.getRepositoryName() ); } connectDropdown.setText( connectionLabel.toString() ); connectDropdown.setToolTipText( connectionLabelTip.toString() ); } else { connectDropdown.setText( BaseMessages.getString( PKG, "RepositoryConnectMenu.Connect" ) ); } } // This fixes some SWT goofiness toolBar.pack(); toolBar.setBounds( rect ); }
void onSelection (Event ev) { Rectangle bounds = chevron.getBounds(); Event event = new Event(); event.detail = SWT.ARROW; if ((parent.style & SWT.VERTICAL) != 0) { event.x = bounds.x + bounds.width; event.y = bounds.y; } else { event.x = bounds.x; event.y = bounds.y + bounds.height; } event.stateMask = ev.stateMask; sendSelectionEvent (SWT.Selection, event, false); } /**
void onSelection (Event ev) { Rectangle bounds = chevron.getBounds(); Event event = new Event(); event.detail = SWT.ARROW; if ((parent.style & SWT.VERTICAL) != 0) { event.x = bounds.x + bounds.width; event.y = bounds.y; } else { event.x = bounds.x; event.y = bounds.y + bounds.height; } event.stateMask = ev.stateMask; sendSelectionEvent (SWT.Selection, event, false); } /**
void onSelection (Event ev) { Rectangle bounds = chevron.getBounds(); Event event = new Event(); event.detail = SWT.ARROW; if ((parent.style & SWT.VERTICAL) != 0) { event.x = bounds.x + bounds.width; event.y = bounds.y; } else { event.x = bounds.x; event.y = bounds.y + bounds.height; } event.stateMask = ev.stateMask; sendSelectionEvent (SWT.Selection, event, false); } /**
void onSelection() { Rectangle bounds = chevron.getBounds(); Event event = new Event(); event.detail = SWT.ARROW; if ( (parent.style & SWT.VERTICAL) != 0 ) { event.x = bounds.x + bounds.width; event.y = bounds.y; } else { event.x = bounds.x; event.y = bounds.y + bounds.height; } // postEvent (SWT.Selection, event); event.widget = this; notifyListeners( SWT.Selection, event ); }
void onSelection (Event ev) { Rectangle bounds = chevron.getBounds(); Event event = new Event(); event.detail = SWT.ARROW; if ((parent.style & SWT.VERTICAL) != 0) { event.x = bounds.x + bounds.width; event.y = bounds.y; } else { event.x = bounds.x; event.y = bounds.y + bounds.height; } event.stateMask = ev.stateMask; sendSelectionEvent (SWT.Selection, event, false); } /**
void layoutItems() { for( int i = 0; i < itemHolder.size(); i++ ) { ToolItem item = itemHolder.getItem( i ); Rectangle ibounds = item.getBounds(); Rectangle bounds = getBounds(); boolean hasEnoughWidth = ibounds.x + ibounds.width <= bounds.width; boolean hasEnoughHeight = ibounds.y + ibounds.height <= bounds.height; item.setVisible( hasEnoughWidth && hasEnoughHeight ); item.resizeControl(); } }
Rectangle toolbarBounds= fToolBar.getBounds();
Rectangle toolbarBounds= fToolBar.getBounds();
/** * Show the dialog's menu. This message has no effect if the receiver was * not configured to show a menu. Clients may call this method in order to * trigger the menu via keystrokes or other gestures. Subclasses typically * do not override method. */ protected void showDialogMenu() { if (!showDialogMenu) { return; } if (menuManager == null) { menuManager = new MenuManager(); fillDialogMenu(menuManager); } // Setting this flag works around a problem that remains on X only, // whereby activating the menu deactivates our shell. listenToDeactivate = !Util.isGtk(); Menu menu = menuManager.createContextMenu(getShell()); Rectangle bounds = toolBar.getBounds(); Point topLeft = new Point(bounds.x, bounds.y + bounds.height); topLeft = getShell().toDisplay(topLeft); menu.setLocation(topLeft.x, topLeft.y); menu.setVisible(true); }
/** * Show the dialog's menu. This message has no effect if the receiver was * not configured to show a menu. Clients may call this method in order to * trigger the menu via keystrokes or other gestures. Subclasses typically * do not override method. */ protected void showDialogMenu() { if (!showDialogMenu) { return; } if (menuManager == null) { menuManager = new MenuManager(); fillDialogMenu(menuManager); } // Setting this flag works around a problem that remains on X only, // whereby activating the menu deactivates our shell. listenToDeactivate = !Util.isGtk(); Menu menu = menuManager.createContextMenu(getShell()); Rectangle bounds = toolBar.getBounds(); Point topLeft = new Point(bounds.x, bounds.y + bounds.height); topLeft = getShell().toDisplay(topLeft); menu.setLocation(topLeft.x, topLeft.y); menu.setVisible(true); }
Rectangle toolbarBounds= fToolBar.getBounds();
/** * Show the dialog's menu. This message has no effect if the receiver was * not configured to show a menu. Clients may call this method in order to * trigger the menu via keystrokes or other gestures. Subclasses typically * do not override method. */ protected void showDialogMenu() { if (!showDialogMenu) { return; } if (menuManager == null) { menuManager = new MenuManager(); fillDialogMenu(menuManager); } // Setting this flag works around a problem that remains on X only, // whereby activating the menu deactivates our shell. listenToDeactivate = !Util.isGtk(); Menu menu = menuManager.createContextMenu(getShell()); Rectangle bounds = toolBar.getBounds(); Point topLeft = new Point(bounds.x, bounds.y + bounds.height); topLeft = getShell().toDisplay(topLeft); menu.setLocation(topLeft.x, topLeft.y); menu.setVisible(true); }
Rectangle toolBarBounds = toolBar.getBounds(); ToolItem[] items = toolBar.getItems(); ArrayList<ToolItem> hidden = new ArrayList<>();
Rectangle toolBarBounds = toolBar.getBounds(); ToolItem[] items = toolBar.getItems(); ArrayList hidden = new ArrayList();
Rectangle bounds = historyManager.getControl().getBounds(); Point topLeft = new Point(bounds.x + bounds.width, bounds.y + bounds.height); topLeft = historyManager.getControl().toDisplay(topLeft);
Rectangle toolBarBounds = toolBar.getBounds(); ToolItem[] items = toolBar.getItems(); ArrayList<ToolItem> hidden = new ArrayList<>();