Visio Drawing Explorer reverse selection? - visio

There's a drawing explorer tool (hidden in developer settings) that allows you to pick any object in the drawing from a selection tree, fair enough. However, how to show what the object is when you click on it on the drawing? I was really surprised that clicking on a drawing object does not highlight in the drawing explorer as well, but it doesn't..
My use case for this is locking a background shape box from selection so I can lasso objects without dragging the background shape around, for that you need to do it on the drawing explorer, not just in "protect" dialog.
If there simply isn't backwards synchronization option between drawing and the drawing explorer, I'd have to know the object name. You'd expect the object name to be shown somewhere as soon as you click on it but it doesn't..
I can right click on the object and pick shapesheet, which shows the name along with a pile of useless (to me) information on the object. You can leave that open but it won't update when you click on another object. Hidden on the developer tab there's a "shape name" option which pops up a modal dialog you can't leave open so it'd show the name of whatever you click on.

There is an extension to do just that (jusmp back to shape in drawing explorer). The installer:
https://unmanagedvisio.com/products/jump-to-shape/
It is free and open source.
I have not updated it for quite a while, but it still works.
The source (if you are interested): https://github.com/nbelyh/JumpToShapeAddin

I found a rather convoluted way of doing this.
First, to show live name of whatever you have clicked on, you need to have the "Diagram navigation" pane open, which shows up from View tab in "show" on task panes icon.
THAT pane highlights whatever you click on and you can rename it. but it doesn't show hierarchy like the drawing explorer but at least you can give a descriptive name by double clicking on a a name on the navigation pane. That name will update on the Drawing explorer (but won't be selected) so you can at find it easily in the tree.
However, you cannot protect a shape by either drawing explorer or diagram navigation panes, so while I now know how to get from drawing object to drawing explorer, it doesn't solve my dilemma, that's an another question.
You have to go to developer tab and pick "protection" icon from "Shape design" section. This does not prevent you from selecting the shape yet.
After this you have to go to the drawing explorer, right click on the top-level document name and pick "protect document", hey presto, now that background shape is not selectable so it won't interfere working on objects on top of it.

Related

Adding New Components in WindowBuilder Design View

At risk of this being a trivial question, I need to know how to add more components (in the components explorer) in WindowBuilder for Eclipse Juno. I'm taking a dive and trying learn how to add a GUI to one of my personal projects. Right now all I have mustered up is just a JFrame that has a button that launches my program in the console with a little notification saying so. But what I am thinking about having is a "Start up Window" with just some stuff and button or something that says Enter application or something. So then I want a new window to pop up as a "Run Window". I have created a new JFrame as a "run window" and hide/set visibility of "startWindow" to false and get the result I want. But I want to be able to edit this new JFrame in the design window along with the default JFrame I started with.
Is there a way to do this? I tried right-clicking in the components window in the design view and it doesn't do anything. I also tried right-click the object from the project explorer and couldn't find anything. Am I missing something? Is this even possible?
The question seems to have 2 parts, so I will try to answer both of them.
1) Adding components directly in the components explorer
The only thing you could do, to get new components into there via right-click is "Surround with". For example you have a JPanel, right-click on it and click "Surround with...". You could try and put a JScrollPanel in there, so you can scroll your JPanel.
But the usual way to add components is by the "Palette", it contains a lot of components, that you can drag&drop into either the components-explorer or directly into your app Window -> Show View -> Palette.
2) Showing a certain window
If I understand this correctly, you want to show one window, click on a button and then show another window which has the same size etc. like the one before.
Setting the visibility for the first window to false and the second does work.
But under certain circumstances it's easier to use CardLayout.
Imagine a stack of cards, you can see only the first card. Then you click a button and now see the second card and so on.
See this: https://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
for information and examples.

How to use color picker (eye dropper)?

There is a very useful tool built in chrome dev tool, that I have just discovered. I even don't know its name, and I am not able to find it on google. I would say it is a pixel inspector tool.
I find the following method how to use it:
1a. Inspect an html element with background color.
1b. Define background color of an element.
Click on the color picker.
Move your mouse over any element on the page (not on the dev tool)
See: http://skalar.darkware.hu/skalkaz/Chrome-Colorpicker.gif
My questions:
What is this tool name?
How to use it easily? Most of the time I don't care the color, but I want to inspect the pixels of an icon.
Is there a hotkey of this tool?
To open the Eye Dropper simply:
Open DevTools F12
Go to Elements tab
Under Styles side bar click on any color preview box
Its main functionality is to inspect pixel color values by clicking them though with its new features you can also see your page's existing colors palette or material design palette by clicking on the two arrows icon at the bottom. It can get quite handy when designing your page.
It is just called the eyedropper tool. There is no shortcut key for it that I'm aware of. The only way you can use it now is by clicking on the color picker box in styles sidebar and then clicking on the page as you have already been doing.
Currently, the eyedropper tool is not working in my version of Chrome (as described above), though it worked for me in the past. I hear it is being updated in the latest version of Chrome.
However, I'm able to grab colors easily in Firefox.
Open page in Firefox
Hamburger Menu -> Web Developer -> Eyedropper
Drag eyedropper tool over the image... Click.
Color is copied to your clipboard, and eyedropper tool goes away.
Paste color code
In case you cannot get the eyedropper tool to work in Chrome, this is a good work around.
I also find it easier to access :-)

Files get opened in wrong editing area

my Eclipse Juno SR1 somehow got screwed up. It seems I have a new area, and if I interpret it correctly, it is called the "Shared Area" (only from a tooltip). I cannot get rid of it by conventional means (i.E. closing/hiding). All files I open now are opened in this shared area, not in the area my files were opened before. The area is distinct from the normal editing area in that it will not go to the same place (top right, under the menus).
The area has only maximize and minimize buttons. Maximizing it will maximize it over everything, this would be expected. Minimizing it actually hides it, but opening an existing file will bring it back as kind of a popup over the eclipse file list.
I do not seem to find how I activated this feature, and I cannot seem to find any activation instructions in the Eclipse help (the help looking for "shared" and "area" separately doesn't really help anyway).
I just want this feature/window/perspective to go away and let me open files like I used to. Any tips?
Edit: Maybe this area is not called "Shared area", this could be wrong. If not, it doesn't seem to have any name. It just forces all editors opening new files to open in it, and not in the area that they usually open in. The way I determined it was called "Shared area" is by minimizing it, then opening a file. It opens as kind of a popup (described above), and there's a menu bar attached with 2 icons, "Restore" and "Shared area", which is pre-selected.
This is the are "docked" to the right:
This is the area docked below:
The area is not dockable in the way that it docks to certain areas of Eclipse, but stretches (when dragged) over the whole Eclipse Window and even outside of it.
You should reset the perspective Window -> Reset Perspective...
The shared area is the default location to open files. The files remain open in the shared area across different perspectives such as Java and Debug so that you can switch between them while working on the same files. You'd generally drag a file outside the shared area to work on it without it appearing in other perspectives.
It's hard to position the shard area view by dragging it, but you can drag the surrounding views in place around it to get it where you want.
I click on the bottom corner of the offending tile and dragged in till it closed! The "reset perspective" did not work for me but the draggin to a smaller size as if it were a picture did. Hope this helps.
If nothing works out for you, simply go to window -> new Window. Opens up a fresh copy of eclipse with everything loaded up. Even on a restart,loads up like normally it would.
I think I know what you mean. If you drag any view to that "Shared Area" but not to the body but to the header (where the title is supposed to be) the dragged view will occupy completely that "Shared Aread".
Hope that helps.
Here's what worked for me:
Menu > Window > Perspective > Open Perspective > Other > Java(default) > Open
Now I can create a new class that shows on the tab next to my working tab.
Ctrl+Shift+{ to toggle it on or Off.
Ctrl+Shift+W to close both of the area.

Is there a way to set "waypoints" in an Eclipse file? Meaning

I'm working in a file that's thousands of lines of code. I'm implementing an algorithm at line 700-ish. I frequently have to navigate away from those lines to check out the other methods in the file.
Navigating back to where I'm actually coding is usually a pain. If I could set a waypoint at line 700 and map a shortcut to it that would be great. It would also be nice to be able to do this on a file level too.
Is there any way to do this in Eclipse? If not, should there be?
I don't control the file so I can't break it up into smaller files/classes.
There's a Bookmark view in Eclipse that would probably work for this.
On any line of source (at least in the Java view), right click in the left hand tray. You'll see a menu pop up and an option called Bookmark. Select that and provide some kind of useful description that you'll remember.
Now, add the Bookmarks view to your perspective.
Click on Window
Select Show View
Select Other (at the bottom)
Select Bookmarks under General (or just enter Bookmarks in the search box).
You should now have the Bookmarks view in your perspective listing your bookmarks. Duble click on one of the bookmarks and it will take you right to it.
Hope that helps.

Eclipse code template to insert a bookmark?

Eclipse has a nifty feature which allows you to define "templates" for code. I have created one to automatically put in a println and add a "TODO" comment. I'd like for this to also add a bookmark so I can easily find it again.
(The codebase I am working with makes it unfeasible to use just the Task List to find what I need to do since there are a lot of TODOs laying around.)
My current template is simply System.out.println("don't commit me!"); //TODO: fix this ${cursor}.
A bookmark is part of the editor.
You can find all of your TODO comments in the Eclipse Tasks view. If the Tasks view isn't open, just left click on Window -> Show View -> Tasks (not Task List).
If you left click on the Tasks description to make sure the Tasks view has focus, then double click on the Tasks description, Eclipse will open the editor and take you to the TODO line.
If you have the code already open in the Eclipse editor, Eclipse draws blue rectangles on the right side of the editor to mark all of the TODO comments. Left clicking on the blue rectangles will take you to the TODO comment line.
Edited to add: You can sort the Tasks view by clicking on any of the titles, like Resource.
I don't think it's possible via a code template.
It's certainly possible with the a key shortcut that can be assigned to add bookmark in:
Window->Preferences->Keys
but you still have the prompt to enter the name of the bookmark (rather than use a default set of text).
If you really want to get close to the functionality you want you could take a look at the Eclipse Bookmarks plugin:
http://www.etc.to/eclipse_bookmarks_plugin
and maybe hack it to do what you want... (if it doesn't already)...