/** * Create the coolbar manager. * * @param style the style * @return the coolbar manager */ @Override protected CoolBarManager createCoolBarManager(int style) { CoolBarManager coolBarManager = new CoolBarManager(style); actionFactory = new ActionFactory(this); ToolBarManager toolBarManager = new ToolBarManager(); coolBarManager.add(toolBarManager); addtoolbarAction(toolBarManager, ImagePathConstant.CLEAR_EXEC_TRACKING_CONSOLE, actionFactory.getAction(ClearConsoleAction.class.getName())); addtoolbarAction(toolBarManager, ImagePathConstant.CONSOLE_SCROLL_LOCK, actionFactory.getAction(ScrollLockAction.class.getName())); return coolBarManager; }
public boolean close() { if (operationInProgress) { return false; } if (super.close()) { if (menuBarManager != null) { menuBarManager.dispose(); menuBarManager = null; } if (toolBarManager != null) { if (toolBarManager instanceof IToolBarManager2) { ((IToolBarManager2) toolBarManager).dispose(); } else if (toolBarManager instanceof ToolBarManager) { ((ToolBarManager) toolBarManager).dispose(); } toolBarManager = null; } if (statusLineManager != null) { statusLineManager.dispose(); statusLineManager = null; } if (coolBarManager != null) { if (coolBarManager instanceof ICoolBarManager2) { ((ICoolBarManager2) coolBarManager).dispose(); } else if (coolBarManager instanceof CoolBarManager) { ((CoolBarManager) coolBarManager).dispose(); } coolBarManager = null; } return true; } return false; }
/** * Creates the control for the cool bar manager. * <p> * Subclasses may override this method to customize the cool bar manager. * </p> * * @param composite * the parent used for the control * * @return an instance of <code>CoolBar</code> * @since 3.0 */ protected Control createCoolBarControl(Composite composite) { if (coolBarManager != null) { if (coolBarManager instanceof ICoolBarManager2) { return ((ICoolBarManager2) coolBarManager) .createControl2(composite); } if (coolBarManager instanceof CoolBarManager) { return ((CoolBarManager) coolBarManager) .createControl(composite); } } return null; }
/** * Returns the control for the window's cool bar. * <p> * Subclasses may override this method to customize the cool bar manager. * </p> * * @return an instance of <code>CoolBar</code> * @since 3.0 */ protected Control getCoolBarControl() { if (coolBarManager != null) { if (coolBarManager instanceof ICoolBarManager2) { return ((ICoolBarManager2) coolBarManager).getControl2(); } if (coolBarManager instanceof CoolBarManager) { return ((CoolBarManager) coolBarManager).getControl(); } } return null; }
@Override public boolean close() { if (operationInProgress) { return false; } if (super.close()) { if (menuBarManager != null) { menuBarManager.dispose(); menuBarManager = null; } if (toolBarManager != null) { if (toolBarManager instanceof IToolBarManager2) { ((IToolBarManager2) toolBarManager).dispose(); } else if (toolBarManager instanceof ToolBarManager) { ((ToolBarManager) toolBarManager).dispose(); } toolBarManager = null; } if (statusLineManager != null) { statusLineManager.dispose(); statusLineManager = null; } if (coolBarManager != null) { if (coolBarManager instanceof ICoolBarManager2) { ((ICoolBarManager2) coolBarManager).dispose(); } else if (coolBarManager instanceof CoolBarManager) { ((CoolBarManager) coolBarManager).dispose(); } coolBarManager = null; } return true; } return false; }
/** * Creates the control for the cool bar manager. * <p> * Subclasses may override this method to customize the cool bar manager. * </p> * @param composite the parent used for the control * * @return an instance of <code>CoolBar</code> * @since 3.0 */ protected Control createCoolBarControl(Composite composite) { if (coolBarManager != null) { if (coolBarManager instanceof ICoolBarManager2) { return ((ICoolBarManager2) coolBarManager).createControl2(composite); } if (coolBarManager instanceof CoolBarManager) { return ((CoolBarManager) coolBarManager).createControl(composite); } } return null; }
protected CoolBarManager createCoolBarManager(int style) { CoolBarManager coolBar = new CoolBarManager(style); ToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.WRAP); toolBar.add(mapOpen); toolBar.add(mapNew); toolBar.add(mapAdd); toolBar.add(new Separator()); toolBar.add(mapSeq); toolBar.add(mapTrs); toolBar.add(mapPrint); toolBar.add(mapRender); toolBar.add(mapLabel); toolBar.add(mapAttr); toolBar.add(new Separator()); // toolBar.add(delphiTable); toolBar.add(newTable); toolBar.add(fileTrans); toolBar.add(toolDir); toolBar.add(editCell); toolBar.add(new Separator()); toolBar.add(proNew); toolBar.add(proOpen); toolBar.add(proInfo); // toolBar.add(exit); coolBar.add(toolBar); return coolBar; }
/** * Create the coolbar manager. * * @return the coolbar manager */ @Override protected CoolBarManager createCoolBarManager(int style) { CoolBarManager coolBarManager = new CoolBarManager(style); actionFactory = new ActionFactory(this); ToolBarManager toolBarManager = new ToolBarManager(); coolBarManager.add(toolBarManager); addtoolbarAction(toolBarManager, ImagePathConstant.DATA_VIEWER_EXPORT, actionFactory.getAction(ExportAction.class.getName())); /* * addtoolbarAction( toolBarManager, (XMLConfigUtil.CONFIG_FILES_PATH + ImagePathConstant.DATA_VIEWER_FIND), * actionFactory.getAction(FindAction.class.getName())); */ addtoolbarAction(toolBarManager, ImagePathConstant.DATA_VIEWER_RELOAD, actionFactory.getAction(ReloadAction.class.getName())); /* * addtoolbarAction( toolBarManager, (XMLConfigUtil.CONFIG_FILES_PATH + ImagePathConstant.DATA_VIEWER_FILTER), * actionFactory.getAction(FilterAction.class.getName())); */ addtoolbarAction(toolBarManager,ImagePathConstant.RESET_SORT, actionFactory.getAction(ResetSortAction.class.getName())); addtoolbarAction(toolBarManager,ImagePathConstant.TABLE_ICON, actionFactory.getAction(SelectColumnAction.class.getName())); addtoolbarAction(toolBarManager, ImagePathConstant.FIND_DATA, actionFactory.getAction(FindAction.class.getName())); addtoolbarAction(toolBarManager, ImagePathConstant.AUTO_ADJUST_COLUMNS, actionFactory.getAction(AutoExpandColumnsAction.class.getName())); dropDownAction = new Action("", SWT.DROP_DOWN) { @Override public void run() { tabFolder.showItem(tabFolder.getItem(0)); tabFolder.setSelection(0); } }; dropDownAction.setImageDescriptor(new ImageDescriptor() { @Override public ImageData getImageData() { return ImagePathConstant.DATA_VIEWER_SWITCH_VIEW.getImageFromRegistry().getImageData(); } }); dropDownAction.setMenuCreator(new ViewDataGridMenuCreator(actionFactory)); toolBarManager.add(dropDownAction); return coolBarManager; }
@Override public void addFeatures() { setWeights(new int[] { 25, 75 }); isoTreeCLabel.setText("Iso explorer"); isoTreeCLabel.setImage(ImageUtils.getInstance().loadImage("iso.png")); CoolBarManager coolbar = new CoolBarManager(isoTableCoolBar); ToolBarManager toolbar = new ToolBarManager(SWT.WRAP | SWT.FLAT); toolbar.add(OpenIsoEntryAction.getInstance()); toolbar.add(GoToIsoEntryParentAction.getInstance()); toolbar.add(ShowIsoInformationAction.getInstance()); toolbar.add(DeleteIsoEntryAction.getInstance()); coolbar.add(toolbar); coolbar.update(true); CoolItem coolItem = new CoolItem(isoTableCoolBar, SWT.WRAP | SWT.FLAT); isoTableText = new Text(isoTableCoolBar, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER); isoTableText.pack(); coolItem.setSize(isoTableText.getSize()); coolItem.setControl(isoTableText); List<String> columnNames = new ArrayList<String>(); { columnNames.add("Name"); columnNames.add("Size"); columnNames.add("Type"); columnNames.add("Last Modified Date"); } List<String> tooltips = new ArrayList<String>(); { tooltips.add("Name"); tooltips.add("Size"); tooltips.add("Type"); tooltips.add("Last Modified Date"); } Iterator<String> it = tooltips.iterator(); for (String columnName : columnNames) { TableColumn tvc = new TableColumn(isoDirectoriesTable.getTable(), SWT.LEFT); tvc.setText(columnName); tvc.setToolTipText(it.next()); tvc.setWidth(200); tvc.setMoveable(true); tvc.setResizable(true); } isoDirectoriesTable.getTable().setHeaderVisible(true); isoDirectoriesTree.setContentProvider(new IsoTreeContentProvider()); isoDirectoriesTree.setLabelProvider(new IsoTreeLabelProvider()); isoDirectoriesTree.addFilter(new ShowOnlyIsoDirectoriesFilter()); isoDirectoriesTree.setSorter(new SortByIsoEntryFirstSorter()); isoDirectoriesTable.setContentProvider(new IsoTableProvider()); isoDirectoriesTable.setLabelProvider(new IsoTableProvider()); isoDirectoriesTable.setSorter(new SortByIsoEntryFirstSorter()); GridDataFactory.defaultsFor(isoTreeCLabel).grab(true, false).applyTo(isoTreeCLabel); GridDataFactory.defaultsFor(isoDirectoriesTree.getControl()).grab(true, true) .applyTo(isoDirectoriesTree.getControl()); GridLayoutFactory.fillDefaults().generateLayout(composites.get(0)); GridDataFactory.defaultsFor(isoTableCoolBar).grab(true, false).applyTo(isoTableCoolBar); GridDataFactory.defaultsFor(isoDirectoriesTable.getControl()).grab(true, true) .applyTo(isoDirectoriesTable.getControl()); GridLayoutFactory.fillDefaults().generateLayout(composites.get(1)); }
@Override public void addFeatures() { setWeights(new int[] { 25, 75 }); osTreeCLabel.setText("File explorer"); osTreeCLabel.setImage(ImageUtils.getInstance().loadImage("drive.png")); CoolBarManager coolbar = new CoolBarManager(osTableCoolBar); ToolBarManager toolbar = new ToolBarManager(SWT.WRAP | SWT.FLAT); toolbar.add(OpenAction.getInstance()); toolbar.add(GoToParentAction.getInstance()); toolbar.add(RefreshExplorerAction.getInstance()); toolbar.add(AddFileAction.getInstance()); toolbar.add(ShowHiddenFilesAction.getInstance()); coolbar.add(toolbar); coolbar.update(true); CoolItem coolItem = new CoolItem(osTableCoolBar, SWT.WRAP | SWT.FLAT); osTableText = new Text(osTableCoolBar, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER); osTableText.pack(); coolItem.setSize(osTableText.getSize()); coolItem.setControl(osTableText); List<String> tooltips = new ArrayList<String>(); { tooltips.add("File name"); tooltips.add("File size, in bytes"); tooltips.add("File type"); tooltips.add("File kast modified date"); } List<String> columnNames = new ArrayList<String>(); { columnNames.add("Name"); columnNames.add("Size"); columnNames.add("Type"); columnNames.add("Last Modified Date"); } Iterator<String> it = tooltips.iterator(); for (String columnName : columnNames) { TableColumn tvc = new TableColumn(osDirectoriesTable.getTable(), SWT.LEFT); tvc.setText(columnName); tvc.setToolTipText(it.next()); tvc.setWidth(200); tvc.setMoveable(true); tvc.setResizable(true); } osDirectoriesTable.getTable().setHeaderVisible(true); osDirectoriesTree.setContentProvider(new OSTreeContentProvider()); osDirectoriesTree.setLabelProvider(new OSTreeLabelProvider()); osDirectoriesTree.addFilter(new ShowOnlyDirectoriesFilter()); osDirectoriesTree.addFilter(new HideHiddenFilesFilter()); osDirectoriesTree.setSorter(new SortByDirectoriesFirstSorter()); osDirectoriesTree.setInput(OSExplorer.getInstance()); osDirectoriesTable.setContentProvider(new OsTableProvider()); osDirectoriesTable.setLabelProvider(new OsTableProvider()); osDirectoriesTable.addFilter(new HideHiddenFilesFilter()); osDirectoriesTable.setSorter(new SortByDirectoriesFirstSorter()); GridDataFactory.defaultsFor(osTreeCLabel).grab(true, false).applyTo(osTreeCLabel); GridDataFactory.defaultsFor(osDirectoriesTree.getControl()).grab(true, true) .applyTo(osDirectoriesTree.getControl()); GridLayoutFactory.fillDefaults().generateLayout(composites.get(0)); GridDataFactory.defaultsFor(osTableCoolBar).grab(true, false).applyTo(osTableCoolBar); GridDataFactory.defaultsFor(osDirectoriesTable.getControl()).grab(true, true) .applyTo(osDirectoriesTable.getControl()); GridLayoutFactory.fillDefaults().generateLayout(composites.get(1)); }
/** * Create the coolbar manager * @return the coolbar manager */ protected CoolBarManager createCoolBarManager(int style) { CoolBarManager coolBarManager = new CoolBarManager(style); return coolBarManager; }
/** * Returns the cool bar manager for this window. * * @return the cool bar manager, or <code>null</code> if this window does * not have a cool bar * @see #addCoolBar(int) * @since 3.0 */ public CoolBarManager getCoolBarManager() { if (coolBarManager instanceof CoolBarManager) { return (CoolBarManager) coolBarManager; } return null; }
/** * Returns the cool bar manager for this window. * * @return the cool bar manager, or <code>null</code> if * this window does not have a cool bar * @see #addCoolBar(int) * @since 3.0 */ public CoolBarManager getCoolBarManager() { if (coolBarManager instanceof CoolBarManager) { return (CoolBarManager)coolBarManager; } return null; }
/** * Returns a new cool bar manager for the window. * <p> * Subclasses may override this method to customize the cool bar manager. * </p> * * @param style * swt style bits used to create the Coolbar * * @return a cool bar manager * @since 3.0 * @see CoolBarManager#CoolBarManager(int) * @see CoolBar for style bits */ protected CoolBarManager createCoolBarManager(int style) { return new CoolBarManager(style); }
/** * Returns a new cool bar manager for the window. * <p> * Subclasses may override this method to customize the cool bar manager. * </p> * * @param style swt style bits used to create the Coolbar * * @return a cool bar manager * @since 3.0 * @see CoolBarManager#CoolBarManager(int) * @see CoolBar for style bits */ protected CoolBarManager createCoolBarManager(int style) { return new CoolBarManager(style); }