Changeset 1548


Ignore:
Timestamp:
01/26/21 09:45:54 (3 years ago)
Author:
bnemhaus
Message:

With a Item under your cursor, pressing left and right mouse buttons at the same time, extracts the properties of that item. (No change)
However, if an Item is attached to the users cursor when doing this, nothing happens. Now, instead of nothing happening, all attached Items are checked to see if they are in the format of "Property:". If they are then those specified properties are extracted.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.classpath

    r1273 r1548  
    44        <classpathentry exported="true" kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
    55        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    6         <classpathentry kind="lib" path="releases/jars/activation.jar"/>
    7         <classpathentry kind="lib" path="releases/jars/cobra.jar"/>
    86        <classpathentry kind="lib" path="releases/jars/iText-2.1.3.jar"/>
    97        <classpathentry kind="lib" path="releases/jars/jcommon-1.0.13.jar"/>
     
    119        <classpathentry kind="lib" path="releases/jars/JFreeCharts.jar"/>
    1210        <classpathentry kind="lib" path="releases/jars/js.jar"/>
    13         <classpathentry kind="lib" path="releases/jars/jython-standalone-2.7.0.jar"/>
    1411        <classpathentry kind="lib" path="releases/jars/lobo.jar"/>
    15         <classpathentry kind="lib" path="releases/jars/lobo-pub.jar"/>
    1612        <classpathentry kind="lib" path="releases/jars/xercesImpl.jar"/>
    1713        <classpathentry kind="lib" path="releases/jars/jazzy-core.jar"/>
     
    2218        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
    2319        <classpathentry kind="lib" path="releases/jars/svgSalamander.jar"/>
    24         <classpathentry kind="lib" path="releases/jars/jl1.0.1.jar"/>
    25         <classpathentry kind="lib" path="releases/jars/tritonus_share.jar"/>
    26         <classpathentry kind="lib" path="releases/jars/mp3spi1.9.5.jar"/>
    27         <classpathentry kind="lib" path="releases/jars/TarsosDSP-2.3.jar"/>
    2820        <classpathentry kind="lib" path="releases/jars/javax.mail.jar"/>
    29         <classpathentry kind="lib" path="releases/jars/sqlite-jdbc-3.23.1.jar"/>
    3021        <classpathentry kind="lib" path="releases/jars/Shamir.jar"/>
    3122        <classpathentry kind="output" path="bin/src"/>
  • trunk/META-INF/MANIFEST.MF

    r1244 r1548  
    55Bundle-Version: 1.0.0.qualifier
    66Bundle-ClassPath: Expeditee.jar,
    7  releases/jars/activation.jar,
    8  releases/jars/cobra.jar,
    97 releases/jars/iText-2.1.3.jar,
    108 releases/jars/jcommon-1.0.13.jar,
     
    1311 releases/jars/js.jar,
    1412 releases/jars/lobo.jar,
    15  releases/jars/lobo-pub.jar,
    1613 releases/jars/mail.jar,
    1714 releases/jars/xercesImpl.jar,
     
    6966 com.mxgraph.util.svg,
    7067 com.mxgraph.view,
    71  com.steadystate.css,
    72  com.steadystate.css.dom,
    73  com.steadystate.css.parser,
    74  com.steadystate.css.parser.selectors,
    75  com.sun.activation.registries,
    76  com.sun.activation.viewers,
    7768 com.sun.mail.handlers,
    7869 com.sun.mail.iap,
     
    9889 com.swabunga.util,
    9990 images,
    100  javax.activation,
    10191 javax.mail,
    10292 javax.mail.event,
     
    236226 org.lobobrowser.context,
    237227 org.lobobrowser.gui,
    238  org.lobobrowser.html,
    239  org.lobobrowser.html.domimpl,
    240  org.lobobrowser.html.gui,
    241  org.lobobrowser.html.io,
    242  org.lobobrowser.html.js,
    243  org.lobobrowser.html.parser,
    244  org.lobobrowser.html.renderer,
    245  org.lobobrowser.html.style,
    246  org.lobobrowser.html.test,
    247228 org.lobobrowser.io,
    248  org.lobobrowser.js,
    249229 org.lobobrowser.main,
    250230 org.lobobrowser.protocol.res,
     
    305285 org.nfunk.jepexamples,
    306286 org.nfunk.jeptesting,
    307  org.w3c.css.sac,
    308  org.w3c.css.sac.helpers,
    309  org.w3c.dom.css,
    310287 org.w3c.dom.html,
    311  org.w3c.dom.html2,
    312  org.w3c.dom.stylesheets,
    313  org.w3c.dom.views,
    314288 org.xamjwg.platform,
    315289 properties,
  • trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java

    r1532 r1548  
    47164716         * attributes, so it is not checked.
    47174717         *
     4718         * 25/01/2021: If the user has Items attached to the cursor, they are used to
     4719         * specify what attributes to extract.  For example, if the user has "Width:"
     4720         * attached to their cursor, only the width attribute will be extracted rather
     4721         * than all of them.
     4722         *
    47184723         * @param toExtract
    47194724         *            Item containing the Item to extract the attributes from.
     
    47234728                        return;
    47244729                }
    4725 
    4726                 if (FreeItems.hasItemsAttachedToCursor()) {
    4727                         return;
    4728                 }
    4729 
     4730               
    47304731                Item attribs;
    47314732                Item item = toExtract;
     4733                Object toExtractFrom = item.isFrameName() ? item.getParent() : item;
     4734
    47324735                // Extract the frames attributes when the user clicks on the frame name
    47334736                FrameGraphics.changeHighlightMode(item, HighlightMode.None);
    47344737                if (item.isFrameName()) {
    4735                         attribs = AttributeUtils.extractAttributes(item.getParent());
     4738                        attribs = AttributeUtils.extractAttributes(toExtractFrom);
    47364739                } else {
    4737                         attribs = AttributeUtils.extractAttributes(item);
     4740                        attribs = AttributeUtils.extractAttributes(toExtractFrom);
     4741                }
     4742               
     4743                if (FreeItems.hasItemsAttachedToCursor()) {
     4744                        return;
    47384745                }
    47394746
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r1513 r1548  
    2222import java.lang.reflect.InvocationTargetException;
    2323import java.lang.reflect.Method;
     24import java.util.Collection;
    2425import java.util.HashMap;
    2526import java.util.LinkedList;
     
    427428                        throw new IncorrectTypeException("toExtract", "Item | Frame");
    428429                }
    429 
     430               
     431                // If there are Items attached to cursor, extract only those properties being asked for
     432                if (FreeItems.hasItemsAttachedToCursor()) {
     433                        extractSpecifiedAttributes(toExtract, attribSet);
     434                        return null;
     435                }
     436               
    430437                // StringBuffer to store all the extracted Attribute:Value pairs
    431438                StringBuffer attributes = new StringBuffer();
     
    468475        }
    469476
     477        /**
     478         * Extracts only the attributes specified by the FreeItems. 
     479         * Designed to be called exclusively from AttributeUtils::extractAttributes
     480         * @param toExtract The Item or Frame to extract attributes from
     481         * @param attributes The set of attributes to consult
     482         */
     483        private static void extractSpecifiedAttributes(Object toExtract, AttributeSet attributes) {
     484                Collection<Text> textItemsOnCursor = FreeItems.getTextItems();
     485                List<String> keys = attributes.keys;
     486               
     487                for (Text canditate: textItemsOnCursor) {
     488                        String canditateContent = canditate.getText().trim();
     489                        if (canditateContent.charAt(canditateContent.length() - 1) == ':') {
     490                                String attributeName = canditateContent.substring(0, canditateContent.length() - 1);
     491                                String attributeNameLower = attributeName.toLowerCase();
     492                                if (keys.contains(attributeNameLower)) {
     493                                        Attribute a = attributes.get(attributeNameLower);
     494                                        // Make sure the classes of the methods match the item
     495                                        if (a != null && a.getter != null && a.getter.getDeclaringClass().isAssignableFrom(toExtract.getClass())) {     
     496                                                String value = getValue(attributeNameLower, a, toExtract, true);
     497                                                if (value == null) {
     498                                                        continue;
     499                                                }
     500                                                canditate.setText(attributeName + ": " + value);
     501                                        }
     502                                }
     503                        }
     504                }
     505        }
     506               
    470507        /**
    471508         * Gets a string form of the value for a given item get method.
Note: See TracChangeset for help on using the changeset viewer.